Create Pull Request: Non-interactive elements receive keyboard focus

XMLWordPrintable

    Issue Summary

    On the page, the non-interactive <div> element receives keyboard focus.

    Note: A similar issue is observed on the "View Pull Request" page.

    Steps to Reproduce

    1. Navigate to the mentioned page.
    2. Using just a keyboard, tab through the above element.
    3. Observe the focus goes onto the <div> that is not interactive.

    Screenshot 1

    Screenshot 2

    Actual Results

    The non-interactive parent <div> element containing the code changes for the "fake_file_103.txt" file receives keyboard focus. This is because the <div> element inappropriately uses tabindex="0". This is illogical as only interactive elements should receive focus. This may particularly disadvantage keyboard users. The illogical focus order may make the page difficult to understand and interact with.

    Expected Results

    Non-interactive elements must not receive keyboard focus. In this case, we would recommend to remove the tabindex="0" attribute from the <div> element in the DOM.

    <div class="diff-view">
    (...)
    </div>

    Workaround

    Currently, there is no known workaround for this behaviour.

    Environment 

    MacBook Pro (16-inch, 2019)
    macOS 13.4.1 (c) (22F770820d)
    Chrome - Version 115.0.5790.170 (Official Build) (x86_64)
    Firefox- Version 114.0 (64-bit)
    Safari- Version 16.5.2 (18615.2.9.11.10)
    JAWS- Version 2023.2306.28
    NVDA- Version 2022.2.2
    Voiceover - Version Latest

      1. Screenshot 2023-09-28 at 12.51.55 PM.png
        593 kB
        Rahil Shaikh
      2. Screenshot 2023-10-06 at 5.34.45 PM.png
        620 kB
        Rahil Shaikh

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

              Created:
              Updated:
              Resolved: