Create pull request : Focus does not return onto the triggering element

XMLWordPrintable

    Issue Summary

    On the "Create pull request" page, the focus does not return to the element that triggered the content when the new content is closed.

    Steps to Reproduce

    1. Navigate onto the mentioned page.
    2. Navigate onto the "Continue" button and activate it.
    3. Observe that a new content gets opened.
    4. Using just a keyboard, dismiss the new content by activating the "Cancel" button.
    5. Observe that the focus does not return to the element that triggered the content.

    Screen Recording

    Create Pull Request InstEnv _ m1jejwmpe8ydv - Bitbucket Server - Google Chrome 2023-09-28 15-25-37.mp4

    Screen Recording 2023-10-03 at 5.38.32 PM.mov

    Actual Results

    When the "Cancel" button is activated to close the new content, the focus does not return onto the triggering "Continue" button. It instead moves at the top of the page. This illogical focus order might make the page difficult to understand for the keyboard and screen reader users.

    Expected Results

    Make sure that the focus returns to the element that triggered the content. Make sure that when the user dismisses the new content, the focus returns onto the triggering element. This can be done with the “focus” method. For similar examples, please refer “https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/focus

    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 Monterey Version 12.4
    Chrome - Version 103.0.5060.134 (Official Build) (arm64)
    Firefox- Version 93.0 (32-bit)
    Safari- Version 15.5 (17613.2.7.1.8)
    JAWS- Version 2022
    NVDA- Version 2020.3
    Voiceover - Version Latest

            Assignee:
            Carlos Sanchez Rosa
            Reporter:
            Cynthia Singh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: