[OPEN] [#1372] [4.1.0] HtmlEditor, focus on show

  1. #1

    [OPEN] [#1372] [4.1.0] HtmlEditor, focus on show

    Hi,
    HtmlEditor don't get the focus showing the Windows.

    This code works correctly with ext.net 2.5

    <ext:Window ID="WindowComment" runat="server" Title="Comment" Icon="Comment" Width="500" Height="600" Resizable="true"
                BodyStyle="background-color:#fff;" BodyPaddingSummary="5 5 5 5" Layout="BorderLayout" DefaultAnchor="100%" Hidden="true" Modal="true">
    
            <Items>
                <ext:HtmlEditor ID="HtmlEditorComment" runat="server" Region="Center" EnableAlignments="true" EnableFontSize="true" CreateLinkText="CreateLinkText">
                    <ButtonTips>
                        <BackColor Text="BackColor" />
                        <Bold Text="Bold" />
                    </ButtonTips>
                </ext:HtmlEditor>
            </Items>
    
            <Listeners>       
                <Show Handler="#{HtmlEditorComment}.focus();" Delay="50"  />
            </Listeners>
            <Buttons>
                <ext:Button ID="Button1" runat="server" Text="Cancel" Icon="BulletCross" MarginSpec="0 15 0 0" Handler="this.up('window').close();" />
            </Buttons>
        </ext:Window>

    Where am I doing wrong?
    Tks
    Last edited by fabricio.murta; Aug 23, 2016 at 4:04 AM.
  2. #2
    Hello!

    Here's how it would be a proper sample reproducing the issue.

    Steps to reproduce:
    On Internet Explorer 11:
    1. click the 'show window' button so the window is shown. No focus to the editor (type something, nothing goes to the text area).
    2. Click the 'focus editor' button and wait 1-2 seconds. Again, no focus to the editor.

    On Chrome
    1. click the 'show window' button. You can see the cursor blinking on the text area, and typing right away works just fine.
    2. click the 'Focus off editor' button, so the text area loses focus. Typing now does not fill the editor with data.
    3. click the 'Focus editor' button, wait 1-2 seconds. Typing again changes the text inside the editor. Notice no blinking cursor, though.

    <%@ Page Language="C#" %>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <ext:ResourceManager runat="server" />
            <ext:Button ID="b0"
                runat="server"
                Text="Show window"
                Handler="App.WindowComment.show()" />
            <ext:Window
                ID="WindowComment"
                runat="server"
                Title="Comment"
                Width="500"
                Height="600"
                Hidden="true"
                Layout="FitLayout">
                <Items>
                    <ext:HtmlEditor ID="HtmlEditorComment" runat="server">
                    </ext:HtmlEditor>
                </Items>
                <Listeners>       
                    <Show Handler="#{HtmlEditorComment}.focus();" Delay="50"  />
                </Listeners>
                <Buttons>
                    <ext:Button runat="server" Text="Focus off editor" />
                    <ext:Button ID="Button1" runat="server" Text="Cancel" Handler="this.up('window').close();" />
                    <ext:Button
                        ID="b1"
                        runat="server"
                        Text="Focus editor"
                        Handler="Ext.defer(function() {
                                    console.log('Try to focus');
                                    App.HtmlEditorComment.focus();
                                    console.log('tried to focus');
                                 }, 1000);" />
                </Buttons>
            </ext:Window>
        </div>
        </form>
    </body>
    </html>
    Notice I removed all unnecessary components like styling and icons from the example. Setting window as modal or not also didn't change the behavior so the setting was also removed.

    We also logged this issue under #1372 in our github page!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    I look forward to a solution for this problem.
    Last edited by geoffrey.mcgill; Aug 26, 2016 at 11:08 PM.

Similar Threads

  1. Cursor not show after textField.focus()
    By Aod47 in forum 2.x Help
    Replies: 0
    Last Post: Aug 27, 2012, 8:06 AM
  2. [CLOSED] Focus X.Msg.Show
    By majunior in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 27, 2011, 4:02 PM
  3. htmleditor missing listeners for focus and blur
    By craig2005 in forum 1.x Help
    Replies: 4
    Last Post: Jan 14, 2011, 9:33 PM
  4. ext:HtmlEditor doesn't show tooltips
    By Vicentiu in forum 1.x Help
    Replies: 0
    Last Post: Jan 16, 2010, 3:09 AM
  5. Why does scrollbar show in HtmlEditor when no text?
    By dbassett74 in forum 1.x Help
    Replies: 3
    Last Post: May 11, 2009, 4:25 PM

Posting Permissions