Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-5115

On iOS 7, events are dispatched to wrong elements when taping an input field pops the virtual keyboard

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 3.1.0
    • None
    • cordova-ios
    • None
    • iOS 7

    Description

      On iOS 7, when a Cordova 3.1 app contains input fields (<input>, <textarea>), the events such as "focus" and "click" can be dispatched to the wrong element when taping the field causes the virtual keyboard to show up.

      Apparently, the event dispatching mechanism is confused by the fact the page is pushed by the keyboard showing up: the events are dispatched to the element at the coordinate after the push, instead of the element at the coordinate of the initial tap gesture.

      Reproduced with Cordova 3.1 using Xcode 5.0 on Mac OS X 10.8.5, running on iPhone and iPad simulators and real devices.

      How to reproduce:
      Run on iOS 7 a Cordova 3.1 app using the code from the attached test file. The test contains several input elements, and a message area which displays a message for each "focus" and "click" events received by the input elements; the message includes the id of the element. When tapping an input element while the keyboard is not visible, the message shows that the event is received by wrong element. Also, the wrong input is focused. Differently, when the keyboard is already visible, the events are dispatched to the correct element.

      Notes:

      Attachments

        1. test_Cordova-pure-html.html
          2 kB
          Adrian Vasiliu

        Activity

          People

            Unassigned Unassigned
            AdrianVasiliu Adrian Vasiliu
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: