Skip to content
Snippets Groups Projects
Commit 9815001a authored by alexisben's avatar alexisben
Browse files

a11y modal

parent b1a48590
No related branches found
No related tags found
No related merge requests found
......@@ -36,7 +36,8 @@ class Modal {
if (event.keyCode === 27 || event.key === 'Escape') {
this.toggle(false);
} else if (event.key === "Tab") {
this.innerFocus(event);
// TODO fix a11y inner focus
// this.innerFocus(event);
}
});
......@@ -55,6 +56,7 @@ class Modal {
const firstFocusable = focusableInDialog[0];
const lastFocusable = focusableInDialog.at(-1);
console.log(firstFocusable, lastFocusable)
if (!this.state.isOpened) {
return;
}
......@@ -65,6 +67,8 @@ class Modal {
else if (!this.element.contains(event.target)) {
firstFocusable.focus();
}
this.closeButtons[0].focus();
}
toggle(open = !this.state.isOpened) {
......
......@@ -127,5 +127,6 @@ details
@include button-reset
@include icon-block(close, before)
position: absolute
padding: 0
right: 0
top: 0
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment