Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-19980

Edit pull request : Keyboard focus does not return to the triggering element of modal dialog

      Issue Summary

      Keyboard focus does not return to the triggering element of the "Edit pull request" modal dialog.

      Steps to Reproduce

      1. Open the "Home" page.
      2. Activate any repository link from the table.
      3. Now activate Pull request link from left navigation
      4. Activate any link from “Summary” column of data table.
      5. Navigate and activate “Show more pull request actions” > "Edit" buttons > a modal appears.
      6. Close the dialog using the “Cancel" button and try to navigate further.
      7. Observe that the focus moves to the beginning of the page.

      Screen Recording

      Screen Recording 2025-03-04 at 2.52.15 PM.mov

      Actual Results

      On closing the "Edit pull request" modal dialog (that becomes available on activating the “Show more pull request actions” > "Edit" buttons buttons in the main content area) with the help of “Cancel" button, the programmatic focus does not return to the triggering element. Instead, the focus moves 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 parent triggering element of the dialog such as the “Show more pull request actions” button as soon as the "Edit pull request" modal dialog is closed.

      Set the keyboard focus to the triggering element of the modal dialog using the JavaScript .focus().

      For information on creating accessible modal dialog refer !https://www.w3.org/favicon.ico!Modal Dialog Example

      Workaround

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

      Environment

      MacBook Pro (16-inch, 2021)
      macOs Sonoma 14.7
      Chrome - Version 131.0.6778.86 (Official Build) (arm64)
      Firefox- Version 134.0 (64-bit) 
      Safari- Version 18.1.1 (20619.2.8.11.12)
      JAWS- Version 2023
      NVDA- Version 2021.2 
      Voiceover - Version Latest

            [BSERV-19980] Edit pull request : Keyboard focus does not return to the triggering element of modal dialog

            There are no comments yet on this issue.

              Unassigned Unassigned
              88a173d72595 Sojal Shende
              Affected customers:
              0 This affects my team
              Watchers:
              1 Start watching this issue

                Created:
                Updated: