Accessibility · Middle · Question 32 of 75

Why render a custom modal in a React portal?

Show the answer

Correct answer: It escapes parent stacking and makes the background easy to inert

Explanation

Portals only change where the DOM goes. You still have to manage focus, Esc and semantics. Note that React events bubble through the React tree.

Further reading

Problem with a question

Accessibility · Middle · question 32

Test yourself

Take the Accessibility · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz