Skip to content

Can I trigger Modal/Dialog outside of React Comopnent like Toast? #4239

Answered by snowystinger
joshua7v asked this question in Q&A
Discussion options

You must be logged in to vote

I think you want something like https://react-spectrum.adobe.com/react-spectrum/DialogContainer.html
However, there are still some reasons to keep the trigger in many cases. They help a button communicate to screen readers that they will open a popup or dialog, whether it's already open or not, and which one that button controls. Specifically, these aria roles

aria-haspopup
aria-expanded
aria-controls

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@joshua7v
Comment options

@snowystinger
Comment options

Answer selected by joshua7v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants