mirror of
https://github.com/discourse/discourse.git
synced 2025-02-16 16:24:55 +00:00
A11Y: Keep composer as focused element when dismissing Link modal via keyboard (#17893)
This commit is contained in:
parent
a32019d1e7
commit
c66d544cf9
@ -58,6 +58,7 @@ export default Controller.extend(ModalFunctionality, {
|
||||
event.stopPropagation();
|
||||
} else {
|
||||
this.send("closeModal");
|
||||
document.querySelector(".d-editor-input")?.focus();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -98,5 +98,13 @@ acceptance("Composer - Hyperlink", function (needs) {
|
||||
query(".link-url").value.includes("http"),
|
||||
"replaces link url field with internal link"
|
||||
);
|
||||
|
||||
await triggerKeyEvent(".insert-link", "keydown", "Escape");
|
||||
|
||||
assert.strictEqual(
|
||||
document.activeElement.classList.contains("d-editor-input"),
|
||||
true,
|
||||
"focus stays on composer after dismissing modal using Esc key"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user