From ff1b1e405a9daf3796f5c85613a8ea02084d2462 Mon Sep 17 00:00:00 2001 From: Scott Robertson Date: Tue, 8 Mar 2022 10:29:36 -0800 Subject: [PATCH] [fixed] stacked/nested modals have focus lost in Safari Fixes #801 If the `keydown` event within the currently-open, nested modal is propagated, Safari will toggle focus between the parent modal's focusable elements instead. --- src/components/ModalPortal.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/ModalPortal.js b/src/components/ModalPortal.js index 35e9837e..5669f9ca 100644 --- a/src/components/ModalPortal.js +++ b/src/components/ModalPortal.js @@ -275,6 +275,7 @@ export default class ModalPortal extends Component { handleKeyDown = event => { if (event.keyCode === TAB_KEY) { + event.stopPropagation(); scopeTab(this.content, event); }