React·100 questions

How to correctly implement a modal window?

Answer
Render via portal (at the end of body).
Close on Esc and overlay click.
Block scroll of the background.
Maintain focus trap and return focus.
Handle accessibility (role='dialog').
Was this answer helpful?

More questions in this topic

Related questions from other topics