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

Focus restoration failure in onResume()

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: cordova-android
    • Labels:
      None

      Description

      I have a Cordova app running on a keyboard-driven device: it's a TV set-top box without any touchscreen, with Android 7.1.2. The app can launch other activities. Whenever the Cordova app resumes, the focus is moved to another DOM element, the DOM element that had the focus before the app was paused is lost. The order of precedence seems to be:

      • element with tabIndex="0" (or anything !="-1")
      • natively focusable elements, like <input>
      • <body>

      This seems to be caused by the fix for CB-7172. If I comment the fix, the focus is correctly restored to the element that had the focus before pausing.

      This is particularly annoying if the app contains an <input> element, as this will trigger softkeyboard by default when the app is resumed.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              goffioul Michael Goffioul
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: