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

[BUG]: Can't focus on 3d secure popup iframe input with mouse cursor #318

Closed
Neo42 opened this issue Sep 2, 2022 · 5 comments
Closed

[BUG]: Can't focus on 3d secure popup iframe input with mouse cursor #318

Neo42 opened this issue Sep 2, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@Neo42
Copy link

Neo42 commented Sep 2, 2022

What happened?

Can't focus on 3d secure popup iframe input with the mouse cursor. To see the issue, please go to this live app: https://fetchcambs.beezer.com/

After clicking the subscribe button at the bottom, entering the card info, and clicking on the "Pay Now" button, the 3d secure popup shows up, but I can't really focus on the input within and type in anything. Is this something we can control from outside the stripe react js library?

Environment

No response

Reproduction

No response

@Neo42 Neo42 added the bug Something isn't working label Sep 2, 2022
@tylersmith-stripe
Copy link
Contributor

tylersmith-stripe commented Sep 2, 2022

Hey @Neo42 👋 ,

Could you please provide a simplified reproduction, preferably one that is not behind a login wall? Would be happy to take a look. I just ran through a few test 3DS flows on my end, and was able to interact with the modals without issue.

@bmathews-stripe
Copy link
Contributor

@Neo42 We've seen similar reports in the past where code from 3rd party component libraries like material UI have focus trapping behavior that steals focus from the 3DS popup.

If you're showing some kind of loading state via material UI, can you try disabling that and see if it resolves the issue? If it does, maybe there's an option within material UI to disable this focus trapping behavior.

Previous report: #303

@Neo42
Copy link
Author

Neo42 commented Sep 3, 2022

Thanks for your suggestions @tylersmith-stripe @bmathews-stripe. I wasn't able to do a reproduction for this one but managed to resolve it by adding disableAutoFocus, disableEnforceFocus & disableRestoreFocus props to the material UI dialog wrapping the payment element and hijacking the focus event. Thanks for your help again. Closing this one.

@Neo42 Neo42 closed this as completed Sep 3, 2022
@ReMuSoMeGA93
Copy link

This is still an issue. Im using Chakra-UI. The Modal that opens for 3DS verification is created by Stripe or react-stripe, not by my UX library, so I can't give it any instructions to disable autofocus.

@AndruC
Copy link

AndruC commented Mar 12, 2024

This issue is caused by feature in Dialog components that are trapping the browser's focus. This is intended to be an accessibility feature, but this is a special case where we want another pop-up to take focus on top of any Dialogs.

This is still an issue. Im using Chakra-UI. The Modal that opens for 3DS verification is created by Stripe or react-stripe, not by my UX library, so I can't give it any instructions to disable autofocus.

Chakra-UI's Dialog component also traps focus[1]. To resolve this, set the trapFocus property on the Dialog component to false.

For anyone using Material-UI experiencing this issue, you'll need to use the disableEnforceFocus property [2] on any Dialog components that are open when Stripe opens the verification iframe.

You can find documentation for this focus trapping here.

[1] https://github.com/chakra-ui/chakra-ui/blob/bb3ce6671d4b857ebe79ce968c4acbc0b32cff42/packages/components/src/dialog/dialog-root.tsx#L62
[2] https://github.com/mui/material-ui/blob/bda562b435a70e3e8f6d7fb04581c6816a5ba0c7/packages/material-ui/src/Modal/Modal.js#L312

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants