ICEfaces
  1. ICEfaces
  2. ICE-1247

UIInput.requestFocus() not working in IE 6 & 7 when moving from unrendered to rendered

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.5.2
    • Fix Version/s: 1.6DR#4, 1.6
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      Operating System: Windows XP
      Platform: PC

      Description

      calling requestFocus() on a SelectInputText component doesn't seem to work in IE
      6 or 7. Tested with 1.5.3

        Activity

        Hide
        Rob Mayhew added a comment -

        I ran a test with the following call and it works on IE7.
        Using 1.5.3 build.

        public String focusInputTextUserRequestFocus()

        { ((SelectInputText)inputText).requestFocus(); return null; }
        Show
        Rob Mayhew added a comment - I ran a test with the following call and it works on IE7. Using 1.5.3 build. public String focusInputTextUserRequestFocus() { ((SelectInputText)inputText).requestFocus(); return null; }
        Hide
        Ken Fyten added a comment -

        If you can reproduce this, please re-open.

        Show
        Ken Fyten added a comment - If you can reproduce this, please re-open.
        Hide
        Philip Breau added a comment -

        doesn't work in IE6

        Show
        Philip Breau added a comment - doesn't work in IE6
        Hide
        Carlo Guglielmin added a comment -

        I tested Address Demo, which uses a requestFocus() call on the combo box for State when an ambiguous city name is entered. To duplicate the test, enter 'Ashville' for the city, and click to the first name field. The State input will change to a dropdown and focus will be shifted to that.

        I tested 1.5.3, 1.6.0DR2, and the head of the repo, and the focus switched fine in both IE6 and Firefox.

        Show
        Carlo Guglielmin added a comment - I tested Address Demo, which uses a requestFocus() call on the combo box for State when an ambiguous city name is entered. To duplicate the test, enter 'Ashville' for the city, and click to the first name field. The State input will change to a dropdown and focus will be shifted to that. I tested 1.5.3, 1.6.0DR2, and the head of the repo, and the focus switched fine in both IE6 and Firefox.
        Hide
        Ken Fyten added a comment -

        Using the Address demo on IE7 with 1.5.3 and 1.6 DR#2 fails.

        Show
        Ken Fyten added a comment - Using the Address demo on IE7 with 1.5.3 and 1.6 DR#2 fails.
        Hide
        Rob Mayhew added a comment -

        This works in head IE6, FF2, IE7.

        Show
        Rob Mayhew added a comment - This works in head IE6, FF2, IE7.
        Hide
        dukehoops added a comment -
        Show
        dukehoops added a comment - try ICE-1371
        Hide
        Philip Breau added a comment -

        the failure to apply focus is only reproducible when the component is moving from an unrendered to a rendered state on the same lifecycle pass

        Show
        Philip Breau added a comment - the failure to apply focus is only reproducible when the component is moving from an unrendered to a rendered state on the same lifecycle pass
        Hide
        Philip Breau added a comment -

        1. open /support-3882/
        2. click 'focus input'

        • when being rendered on the same pass, the focus isn't applied
          3. click 'toggle hide input' so that the input is in the rendered state
          4. click 'focus input'
        • the input will now focus
        Show
        Philip Breau added a comment - 1. open /support-3882/ 2. click 'focus input' when being rendered on the same pass, the focus isn't applied 3. click 'toggle hide input' so that the input is in the rendered state 4. click 'focus input' the input will now focus
        Hide
        Rob Mayhew added a comment -

        I had to add a slight delay to the focus call (100ms). IE 6 and 7 now focus properly.

        r13596

        Show
        Rob Mayhew added a comment - I had to add a slight delay to the focus call (100ms). IE 6 and 7 now focus properly. r13596
        Hide
        Ted Goddard added a comment -

        A short delay prior to setting focus is unlikely to have any undesirable side effects (outside of focus behavior) as the delay wouldn't block anything else from occurring.

        However, the delay may mean that there is a period of time where nothing is focused, yet the user is expecting some component to be focused. We should take care to ensure that rapid focus operations on the part of the user aren't interfered with by setting the focus later.

        Show
        Ted Goddard added a comment - A short delay prior to setting focus is unlikely to have any undesirable side effects (outside of focus behavior) as the delay wouldn't block anything else from occurring. However, the delay may mean that there is a period of time where nothing is focused, yet the user is expecting some component to be focused. We should take care to ensure that rapid focus operations on the part of the user aren't interfered with by setting the focus later.
        Hide
        Rob Mayhew added a comment -

        In the case where a user changes focus before the server focus call is executed, the server focus call is ignored. Focus is only moved if the user is not interacting with the browser. (Keypress, or mouse click)

        Show
        Rob Mayhew added a comment - In the case where a user changes focus before the server focus call is executed, the server focus call is ignored. Focus is only moved if the user is not interacting with the browser. (Keypress, or mouse click)
        Hide
        Rob Mayhew added a comment -

        Added fix to 1.5 branch. r13650

        Show
        Rob Mayhew added a comment - Added fix to 1.5 branch. r13650

          People

          • Assignee:
            Unassigned
            Reporter:
            Philip Breau
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: