mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
[Editor] Remove the mark from the highlight element and set its role to mark (bug 1889623)
Set aria-label to the highlighted text, this way the focus frame is exactly set on the highlight element and the higlighted text is read.
This commit is contained in:
parent
25f6a0c139
commit
54110de109
2 changed files with 2 additions and 46 deletions
|
@ -562,11 +562,8 @@ class HighlightEditor extends AnnotationEditor {
|
|||
|
||||
const div = super.render();
|
||||
if (this.#text) {
|
||||
const mark = document.createElement("mark");
|
||||
div.append(mark);
|
||||
mark.append(document.createTextNode(this.#text));
|
||||
// The text is invisible but it's still visible by a screen reader.
|
||||
mark.className = "visuallyHidden";
|
||||
div.setAttribute("aria-label", this.#text);
|
||||
div.setAttribute("role", "mark");
|
||||
}
|
||||
if (this.#isFreeHighlight) {
|
||||
div.classList.add("free");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue