Skip to content

Whitelist Prop in Dialogs that use React-focus-trap #1305

@walter-restifo-syzygy

Description

@walter-restifo-syzygy

Is your feature request related to a problem? Please describe. A clear and concise description of what the
problem is. Ex. I'm always frustrated when [...]

In our Capacitor app, we have an unlock screen that appears when you visit another tab and then return to the app. On the unlock screen, you need to enter a PIN before you can continue using the app. If a modal from your useDialog is open, the focus remains in the modal, preventing the unlock screen input from being used to enter the PIN.

Describe the solution you'd like A clear and concise description of what you want to happen.

I believe this issue is related to the react-focus-trap npm package that you use. To resolve this problem, I had to install the package in my app and add input elements to the whitelist prop. My suggestion is to add a whitelist prop to the modal so that the focus does not remain in the modal if it is still open while an unlock screen or some other element is over the modal.

Describe alternatives you've considered A clear and concise description of any alternative solutions or
features you've considered.

Additional context Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions