Skip to content

[Bug]: Accessibility - form items missing labels #22106

Description

@gaj23

Attach (recommended) or Link to PDF file

PDF viewer is missing labels for some form items.

https://mozilla.github.io/pdf.js/web/viewer.html

#pageNumber
Image

pdf.js/web/viewer.html

Lines 376 to 385 in 24de17e

<input
type="number"
id="pageNumber"
class="toolbarField"
value="1"
min="1"
tabindex="0"
data-l10n-id="pdfjs-page-input"
autocomplete="off"
/>

#scaleSelect
Image

pdf.js/web/viewer.html

Lines 401 to 422 in 24de17e

<select id="scaleSelect" tabindex="0" data-l10n-id="pdfjs-zoom-select">
<option id="pageAutoOption" value="auto" selected="selected" data-l10n-id="pdfjs-page-scale-auto"></option>
<option id="pageActualOption" value="page-actual" data-l10n-id="pdfjs-page-scale-actual"></option>
<option id="pageFitOption" value="page-fit" data-l10n-id="pdfjs-page-scale-fit"></option>
<option id="pageWidthOption" value="page-width" data-l10n-id="pdfjs-page-scale-width"></option>
<option
id="customScaleOption"
value="custom"
disabled="disabled"
hidden="true"
data-l10n-id="pdfjs-page-scale-percent"
data-l10n-args='{ "scale": 0 }'
></option>
<option value="0.5" data-l10n-id="pdfjs-page-scale-percent" data-l10n-args='{ "scale": 50 }'></option>
<option value="0.75" data-l10n-id="pdfjs-page-scale-percent" data-l10n-args='{ "scale": 75 }'></option>
<option value="1" data-l10n-id="pdfjs-page-scale-percent" data-l10n-args='{ "scale": 100 }'></option>
<option value="1.25" data-l10n-id="pdfjs-page-scale-percent" data-l10n-args='{ "scale": 125 }'></option>
<option value="1.5" data-l10n-id="pdfjs-page-scale-percent" data-l10n-args='{ "scale": 150 }'></option>
<option value="2" data-l10n-id="pdfjs-page-scale-percent" data-l10n-args='{ "scale": 200 }'></option>
<option value="3" data-l10n-id="pdfjs-page-scale-percent" data-l10n-args='{ "scale": 300 }'></option>
<option value="4" data-l10n-id="pdfjs-page-scale-percent" data-l10n-args='{ "scale": 400 }'></option>
</select>

Using Mac Voice Over:

Screen.Recording.2026-10-07.at.12.10.40.PM.mov

Web browser and its version

All

Operating system and its version

All

PDF.js version

v6.4.299

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

Yes

Is a browser extension

No

Steps to reproduce the problem

axeDev Tools

  1. Go to a pdf using this viewer: https://mozilla.github.io/pdf.js/web/viewer.html
  2. Run axeDev tools on the page with "Best Practices" turned ON
    • "Form elements should have visible label" will be noted in the list

Accessibility Tool

  1. Go to a pdf using this viewer: https://mozilla.github.io/pdf.js/web/viewer.html
  2. Open Voice Over (or another screen reader tool)
  3. Navigate to either the page number input or to the zoom select
    • no label/descriptor is present for the screen reader to provide

What is the expected behavior?

Follow accessibility best practices by applying a label, aria-label, or aria-labelledby.

https://dequeuniversity.com/rules/axe/4.13/label-title-only

What went wrong?

It impacts folks abilities to navigate the pdf viewer with accessibility tools.

Link to a viewer

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions