You found a bug! We've classified it as EXTGWT-2555 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    3
    Vote Rating
    1
    seaoctopus is on a distinguished road

      0  

    Default TextField can't get focus when copying text from other place rather than current page

    TextField can't get focus when copying text from other place rather than current page


    TextField cannot get focus when copying text from other place rather than current page.

    GXT3.0.1
    Exist only in IE

    Hello,
    Assume that there is a login page with a username field and a password field, login button should be enabled as long as both these two field are not empty, when the page pop-up, focus stays in username field by default. Operating according to following steps:
    1. Type “administrator” in the username field (or input text by any other way you like). Keep focus stay in current field.
    2. Switch to notepad (anywhere outside current web page) and copy the password.
    3. Switch back to login page, directly right click in the password field and click on Paste.
    Expected result: password is typed and Login button is enabled.
    Actual result: login button is still disabled.
    I have debugged that the current focus is still in the username field, which means that password field can't get focus this way. All text fields have this common issue, I think this is a common bug related to GXT probably to IE.

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,731
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    Is there a code sample or running app that we can test this with?

  3. #3
    Sencha User
    Join Date
    Jun 2012
    Posts
    3
    Vote Rating
    1
    seaoctopus is on a distinguished road

      0  

    Default


    Attached is a code sample.
    IE8.
    gxt3.0.1
    Operating according to following steps:
    • Press “AddNew” button, enter “003” in the ID field.
    • Switch to notepad (anywhere outside current page), copy a piece of text.
    • Switch back to example page, directly right click in the name field and click on Paste.
    • Focus on Type field; enter a number, press save button of grid editor.
    Expected result: values of all three fields are saved.
    Actual result: the value of name field disappears.
    • When double click the new record and come to an editing mode; the value of name field appears.
    • When press “AddNew” button again after the error occurs, the unsaved value will in the name field.
    Attached Files

  4. #4
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,731
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    I can reproduce this issue in 3.0.1 as well as the latest from SVN. It appears to be related to focusing by that right click - any other way of bringing focus back to the app seems to result in this working correctly. Since the content does make it into the field, it seems that the field somehow hasn't yet noticed that it was focused, so it doesnt save the value after blurring. Additionally, I notice that when I add a second row after the bug has occurred, the Name column already has the value that wasn't saved correctly, and that unless I change this value, it still doesnt save.

    Debugging this slightly, apparently IE8 is making the changes to the field's value (the paste), and only then is it informing JavaScript (and so the GXT code) that the user has focused on the field. The field is accustomed to stale values still being present when it receives new focus, so it ignores this. Then, when blurring, because no change was made since the focus began, the field assumes there was no text entered. As you noted, other browsers behave correctly - before pasting contents, they inform the field that it has focus, so it can perform its function.

    Thanks for the bug report - we'll update this thread when we have some progress to share.

Thread Participants: 1