Skip to content

Commit

Permalink
[fixed] stacked/nested modals have focus lost in Safari
Browse files Browse the repository at this point in the history
Fixes reactjs#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.
  • Loading branch information
Scott Robertson committed Mar 8, 2022
1 parent 68af7ec commit ff1b1e4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/components/ModalPortal.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ export default class ModalPortal extends Component {

handleKeyDown = event => {
if (event.keyCode === TAB_KEY) {
event.stopPropagation();
scopeTab(this.content, event);
}

Expand Down

0 comments on commit ff1b1e4

Please sign in to comment.