Header: Keyboard focus does not return to the triggering element of non-modal dialog

XMLWordPrintable

    • Severity 3 - Minor

      Issue Summary

      When the users close the non-modal dialog the focus moves inappropriately instead of moving to the triggering element.

      Steps to Reproduce

      1. Using a screen reader or only a keyboard, activate the "View your 0 unapproved pull requests" button.
      2. Observe a dialog appears.
      3. Close the dialog using an Esc key or activate the "Close" button and try to navigate further.
      4. Observe that focus moves to the beginning of the page.

      Screen recording

      Screen Recording 2023-10-04 at 12.05.52 PM.mov

      Actual Results

      On closing the non-modal dialog, the programmatic focus does not return to the triggering element. Instead, the focus is moved to the beginning of the page. This required screen reader users and keyboard-only users to tab-pass the content on the page before they could interact with the content after the triggering element.

      Expected Results

      The programmatic focus of users should be set on the triggering element of the dialog as soon as the dialog is closed.
      Set the keyboard focus to the triggering element of the dialog using JavaScript .focus().
       
      For information on creating accessible modal dialog refer: https://www.w3.org/WAI/ARIA/apg/example-index/dialog-modal/dialog.html

      Workaround

      Currently, there is no known workaround for this behaviour. A workaround will be added here when available.

      Environment

      MacBook Pro (16-inch, 2019)
      macOs Ventura 13.5.1
      Chrome - Version 113.0.5672.63 (Official Build) (x86_64)
      Firefox- Version 92.0 (64-bit)
      Safari- Version 16.4 (18615.1.26.110.1)
      JAWS- Version 2022
      NVDA- Version 2021.2
      Voiceover - Version Latest

            Assignee:
            Unassigned
            Reporter:
            Nayan Kamble (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: