ICEfaces
  1. ICEfaces
  2. ICE-6090

Setting focus on newly rendered part of the page doesn't work in IE

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.2-EE-GA_P01
    • Fix Version/s: 1.8.3, 1.8.2-EE-GA_P02
    • Component/s: Bridge
    • Labels:
      None
    • Environment:
      ICEfaces 1 Internet Explorer IE

      Description

      There's a well known issue with trying to programmatically apply focus to elements in IE after an Ajax response has been applied to the DOM. In ICE-1247, we applied one common strategy of applying a slight delay before applying the focus. Unfortunately, this doesn't always work. In the customer's test case, the length of the delay only had a partial impact on the success of setting focus.

      - If blockUIOnSubmt was set to false, the delay only helped in allowing enough time to move the mouse outside the button. In other words, the focus wouldn't be applied at all if the mouse was not moved outside the button before the delay expired.

      - If blockUIOnSubmt was set to true, then the delay only helpled in allowing enough time to move the mouse (but did not have to be outstide the button). In other words, the focus wouldn't be applied at all if the mouse was not moved somewhere before the delay expired.

      Not sure what the relationship between moving the mouse (in our out of the button) and applying the focus to a different element have with IE, but setting blockUIOnSubmit and changing the delay value proved unreliable in this case.

        Activity

        Hide
        Deryk Sinotte added a comment -

        Linking to customer case.

        Show
        Deryk Sinotte added a comment - Linking to customer case.
        Hide
        Deryk Sinotte added a comment -

        Turns out that the solution was eventually provided by searching and finding people who had similiar issues:

        http://stackoverflow.com/questions/766566/cant-focus-input-field-in-dom-loaded-with-ajax-call
        http://www.mkyong.com/javascript/focus-is-not-working-in-ie-solution/

        The secret is to call focus twice for IE. So I updated our focus.js code to do this and it appears to do the trick.

        Show
        Deryk Sinotte added a comment - Turns out that the solution was eventually provided by searching and finding people who had similiar issues: http://stackoverflow.com/questions/766566/cant-focus-input-field-in-dom-loaded-with-ajax-call http://www.mkyong.com/javascript/focus-is-not-working-in-ie-solution/ The secret is to call focus twice for IE. So I updated our focus.js code to do this and it appears to do the trick.

          People

          • Assignee:
            Deryk Sinotte
            Reporter:
            Deryk Sinotte
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: