parent
dcdb4be10b
commit
c57fef7b1e
|
@ -329,6 +329,7 @@ function focusAccessibility() {
|
||||||
if (focusables.includes(el.localName)) {
|
if (focusables.includes(el.localName)) {
|
||||||
if (el.dataset.focusedViaClick === undefined) {
|
if (el.dataset.focusedViaClick === undefined) {
|
||||||
el.dataset.focusedViaClick = '';
|
el.dataset.focusedViaClick = '';
|
||||||
|
focusAccessibility.lastFocusedViaClick = true;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -337,6 +338,7 @@ function focusAccessibility() {
|
||||||
|
|
||||||
function keepOutlineOnTab(event) {
|
function keepOutlineOnTab(event) {
|
||||||
if (event.which === 9) {
|
if (event.which === 9) {
|
||||||
|
focusAccessibility.lastFocusedViaClick = false;
|
||||||
setTimeout(keepOutlineOnTab, 0, true);
|
setTimeout(keepOutlineOnTab, 0, true);
|
||||||
return;
|
return;
|
||||||
} else if (event !== true) {
|
} else if (event !== true) {
|
||||||
|
|
|
@ -36,6 +36,10 @@ function messageBox({
|
||||||
messageBox.originalFocus = document.activeElement;
|
messageBox.originalFocus = document.activeElement;
|
||||||
moveFocus(messageBox.element, 1);
|
moveFocus(messageBox.element, 1);
|
||||||
|
|
||||||
|
if (focusAccessibility.lastFocusedViaClick && document.activeElement) {
|
||||||
|
document.activeElement.dataset.focusedViaClick = '';
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof onshow === 'function') {
|
if (typeof onshow === 'function') {
|
||||||
onshow(messageBox.element);
|
onshow(messageBox.element);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user