ICEfaces
  1. ICEfaces
  2. ICE-9580

setFocus() not being called for submit buttons in Chrome

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-3.3.0.GA_P01
    • Fix Version/s: 4.0.BETA, EE-3.3.0.GA_P02, 4.0
    • Component/s: Bridge
    • Labels:
      None
    • Environment:
      Chrome
    • Assignee Priority:
      P2

      Description

      In Chrome, the bridge code seems not to be calling setFocus() when <input type="submit"/> and <button> elements are clicked/focused. Thus, the last element for which setFocus() was called before pressing the button (and sending a request) will have focus reapplied to it when the response comes to the client. In the particular case of ace:dateTimeEntry in the popup-mode, this will cause the calendar to pop up every time the submit button is pressed.

      For example, in Chrome, in the ace:dateTimeEntry max/min demo, when you click on the maximum date calendar, you'll see this message in the console, as expected:

      [window] persisted focus for element "form:maxIn_input"

      This means that setFocus() was invoked. However, when you click on the 'Submit Max/Min Dates' button, you WON'T see this message in Chrome:

      [window] persisted focus for element "form:submitMinMax"

      This means that setFocus() wasn't invoked for the command button in Chrome. Thus, the calendar will pop up when the response comes back. However, you will be able to see this message in FF and IE, and the calendar won't pop up every time the submit button is pressed.

        Activity

        Hide
        Arturo Zambrano added a comment -

        Assigning to Mircea for comments.

        Show
        Arturo Zambrano added a comment - Assigning to Mircea for comments.
        Hide
        Mircea Toma added a comment -

        I cannot reproduce the issue with Chrome version 30.0.1599.69 but I can with Firefox 24.0.

        Show
        Mircea Toma added a comment - I cannot reproduce the issue with Chrome version 30.0.1599.69 but I can with Firefox 24.0.
        Hide
        Mircea Toma added a comment -

        The difference in behaviour between browsers seems to be caused by the order in which the click and focus events are fired. Our client side focus tracking code monitors the focus events only, when 'Submit Max/Min Dates' is clicked the click event is fired first which in turn triggers the submit, before focus event has a chance to trigger our focus monitoring callback. So, the previously saved submitting element ID is sent during the submit instead the current submit element.

        Show
        Mircea Toma added a comment - The difference in behaviour between browsers seems to be caused by the order in which the click and focus events are fired. Our client side focus tracking code monitors the focus events only, when 'Submit Max/Min Dates' is clicked the click event is fired first which in turn triggers the submit, before focus event has a chance to trigger our focus monitoring callback. So, the previously saved submitting element ID is sent during the submit instead the current submit element.
        Hide
        Mircea Toma added a comment -

        The applied fix adds focus monitoring callback for 'click' events (in addition to focus events).

        Show
        Mircea Toma added a comment - The applied fix adds focus monitoring callback for 'click' events (in addition to focus events).
        Hide
        Mircea Toma added a comment -

        Backported fix.

        Show
        Mircea Toma added a comment - Backported fix.

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Arturo Zambrano
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: