<dialog> element that will appear in the foreground of your app when opened.
If your app makes use of dialog components (most commonly, for modals and pop-ups), you may encounter issues with the Privy dialog interfering with those from your app.
When using other non-Privy dialog elements within your app, we generally recommend:
- Avoid UIs that involve a modal overlaying another modal. This can be a confusing and visually jarring experience for users, especially since users can only interact with a single modal at a time.
- Use the
Dialogcomponent fromheadless-ui, as it has the best compatibility with UI components and HTML elements from third-party libraries like Privy.
Radix UI dialogs
If your app uses theDialog component from Radix UI, we suggest making the following modifications to the default Dialog component:
- Prevent the default behavior of the Radix dialog closing when the user clicks outside of it, via the
onPointerDownOutsideprop of theDialog.Contentcomponent. - Prevent the default behavior of the Radix dialog always trapping the browser’s focus (even if other dialogs are opened), by wrapping your
Dialog.Contentwith theFocusScopecomponent from the@radix-ui/react-focus-scopelibrary. In thisFocusScopecomponent, you should set the proptrappedtofalse. See this GitHub discussion for more info!
Dialog component might look as follows:

