Skip to content

[Bug]: Standard viewer.html uses unnecessary tabindex on #viewerContainer element #20674

@thms-rmb

Description

@thms-rmb

Attach (recommended) or Link to PDF file

In the standard viewer.html there seems to be an unnecessary tabindex on the #viewerContainer element:

<div id="viewerContainer" tabindex="0">

It is not clear to me why the element has tabindex on it. If I focus on it with my keyboard, there is no visual indicator that the element is focused.

Can it be removed?

Web browser and its version

Microsoft Edge Version 144.0.3719.115 (Official build) (arm64)

Operating system and its version

MacOS 26.2 (25C56)

PDF.js version

5.4.624

Is the bug present in the latest PDF.js version?

Yes

Is a browser extension

No

Steps to reproduce the problem

  1. Go to the demo: https://mozilla.github.io/pdf.js/web/viewer.html
  2. Use tab on the keyboard to cycle through elements. After the right-most element Tools, and before the first PDF page, focus is on the #viewerContainer element
  3. See that nothing is visually indicated
  4. See that it appears unnecessary for there to be something to focus between the right-most element Tools. and the first PDF page

What is the expected behavior?

To me the expected behavior is that the #viewerContainer is not focusable. If it must be focusable, it should at least have a visual indication that it is focused.

What went wrong?

I used the keyboard to cycle through elements and saw that it focuses on #viewerContainer but I don't understand why it is in focus.

Link to a viewer

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions