mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-04-09 14:54:04 +02:00
Only focus the undo bar when the focus isn't inside
It should fix the test "must work properly when selecting undo by keyboard" which calls focus() but it can be steal by fixed callback in setTimeout.
This commit is contained in:
parent
b7698d617d
commit
bbf178c5ee
@ -105,7 +105,9 @@ class EditorUndoBar {
|
||||
// Without the setTimeout, VoiceOver will read out the document title
|
||||
// instead of the popup label.
|
||||
this.#focusTimeout = setTimeout(() => {
|
||||
this.#container.focus();
|
||||
if (!this.#container.contains(document.activeElement)) {
|
||||
this.#container.focus();
|
||||
}
|
||||
this.#focusTimeout = null;
|
||||
}, 100);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user