Skip to content

Commit

Permalink
Disable keyboard accessibility outside drawer and modal (SAP#2704)
Browse files Browse the repository at this point in the history
  • Loading branch information
ndricimrr authored May 17, 2022
1 parent 0249ef2 commit 3efb7f4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/src/Modal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,18 @@
onMount(() => {
EventListenerHelpers.addEventListener('message', onMessage);
// only disable accessibility for all cases other than a drawer without backdrop
!(settings.isDrawer && !settings.backdrop) ? IframeHelpers.disableA11YKeyboardExceptClassName('.fd-dialog') : '';
window.focus();
});
onDestroy(() => {
EventListenerHelpers.removeEventListener('message', onMessage);
// only disable accessibility for all cases other than a drawer without backdrop
!(settings.isDrawer && !settings.backdrop) ? IframeHelpers.enableA11YKeyboardBackdropExceptClassName('.fd-dialog') : '';
});
// [svelte-upgrade suggestion]
// [svelte-upgrade suggestion]
// review these functions and remove unnecessary 'export' keywords
export function handleKeydown(event) {
if (event.keyCode === KEYCODE_ESC) {
Expand Down

0 comments on commit 3efb7f4

Please sign in to comment.