Skip to content

Commit

Permalink
Merge pull request #17825 from calixteman/bug1886964
Browse files Browse the repository at this point in the history
[Editor] Add a label to the highight floating button readable with NVDA (bug 1886964)
  • Loading branch information
calixteman authored Mar 23, 2024
2 parents e7203f5 + 63c1c78 commit 14307c0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion l10n/en-US/viewer.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,10 @@ pdfjs-editor-stamp-button-label = Add or edit images
pdfjs-editor-highlight-button =
.title = Highlight
pdfjs-editor-highlight-button-label = Highlight
pdfjs-highlight-floating-button =
pdfjs-highlight-floating-button1 =
.title = Highlight
.aria-label = Highlight
pdfjs-highlight-floating-button-label = Highlight
## Remove button for the various kind of editor.

Expand Down
6 changes: 5 additions & 1 deletion src/display/editor/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,11 @@ class HighlightToolbar {
const button = document.createElement("button");
button.className = "highlightButton";
button.tabIndex = 0;
button.setAttribute("data-l10n-id", `pdfjs-highlight-floating-button`);
button.setAttribute("data-l10n-id", `pdfjs-highlight-floating-button1`);
const span = document.createElement("span");
button.append(span);
span.className = "visuallyHidden";
span.setAttribute("data-l10n-id", "pdfjs-highlight-floating-button-label");
button.addEventListener("contextmenu", noContextMenu);
button.addEventListener("click", () => {
this.#uiManager.highlightSelection("floating_button");
Expand Down
2 changes: 2 additions & 0 deletions web/annotation_editor_layer_builder.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
* for screen readers. */
.visuallyHidden {
position: absolute;
top: 0;
left: 0;
border: 0;
margin: 0;
padding: 0;
Expand Down

0 comments on commit 14307c0

Please sign in to comment.