CCALI / a2jviewer

This is the repo for the A2J Viewer
https://www.a2jauthor.org
Other
5 stars 8 forks source link

Fix the backdrop behind modals #183

Closed chasenlehara closed 2 years ago

chasenlehara commented 2 years ago

Slack thread for context: https://cali.slack.com/archives/C069V9TTN/p1640023807083900

The darker background (backdrop) doesn’t show behind modals: https://github.com/CCALI/a2jviewer/commit/42addeeed9777de3bd222e8e11784734a5853948

That was changed for this issue: https://github.com/CCALI/a2jviewer/issues/43

This should be resolved so that we have the backdrop and it doesn’t conflict with the debug panel.

janebitovi commented 2 years ago

The old 3rd party backdrop couldn't be positioned behind the modal because of where our modal is in DOM vs where the library places their backdrop, so I made a new backdrop built into the modal that's positioned correctly.

aria-hidden state of the modal was 'false' even when the modal was hidden, so I fixed that too

the new backdrop behaves the same as the old one, you can click anywhere to close it etc.

image

Additionally, as a smoke test to call attention to the otherwise easy-to-miss a11y problem with the modal's aria-hidden state, the new backdrop CSS is now tied directly to the state: image if aria-hidden breaks again, so will the backdrop