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

Add workaround for reauth modal immediately closing in Firefox #185

Merged
merged 1 commit into from
May 25, 2023

Conversation

adamwoodnz
Copy link
Contributor

Fixes #180

This PR introduces the workaround mentioned on WordPress/gutenberg#40912, which is to add shouldCloseOnClickOutside={ false } to the modal component, stopping the focus event in the iframe from closing the modal.

The downside is that clicking the modal background will not close the modal anymore, but the close button still works.

Testing

Ensure you use Firefox and other browsers.

To force the modal to popup on the TOTP screen you can modify the script.js condition to something like

else if ( twoFactorRequiredScreens.includes( screen ) ) {
    ...

@adamwoodnz adamwoodnz added this to the MVP milestone May 25, 2023
@adamwoodnz adamwoodnz self-assigned this May 25, 2023
@dd32
Copy link
Member

dd32 commented May 25, 2023

The downside is that clicking the modal background will not close the modal anymore, but the close button still works.

IMHO I think this is a reasonable trade off, if/when the Gutenberg issue is resolved we can re-evaluate it.

Copy link
Member

@dd32 dd32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with:

  • Safari 16.2
  • Firefox 114b8 (Beta)
  • Chrome 110 (Outdated)

Works for me, There's some differences between them like ESC works differently, sometimes it works until you focus into the iframe, etc.. but overall, it feels like things work as expected.

@dd32 dd32 merged commit fd74f02 into trunk May 25, 2023
@dd32 dd32 deleted the fix/180-reauth-modal-firefox branch May 25, 2023 07:07
@adamwoodnz
Copy link
Contributor Author

Looks like a fix for the Gutenberg issue was merged and will be released in v16.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Can't revalidate with Firefox - iframe modal closes upon click
2 participants