Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modal: fix closing when contained iframe is focused #51602

Merged
merged 16 commits into from
Oct 5, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revise comment
  • Loading branch information
stokesman committed Oct 5, 2023
commit 40ae7fe7156f4e94a4d041601eb2ebe9120aa5d0
5 changes: 1 addition & 4 deletions packages/components/src/modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,7 @@ function UnforwardedModal(
onPointerDown: ( event ) => {
if ( event.isPrimary && event.target === event.currentTarget ) {
pressTarget = event.target;
// Avoids loss of focus yet also leaves `useFocusOutside`
// practically useless with its only potential trigger being
// programmatic focus movement. TODO opt for either removing
// the hook or enhancing it such that this isn't needed.
// Avoids focus changing so that focus return works as expected.
event.preventDefault();
}
},
Expand Down