-
Notifications
You must be signed in to change notification settings - Fork 68
feat(coral): Add temporary Modal component #565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
00b3709
to
e048301
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only problem I noticed was that position: absolute
with 100vh
results in the backdrop not extending beyond the initial viewport :o I think it's fixed by position:fixed
.
Screen.Recording.2023-02-07.at.09.05.07.mov
However, I would like to examine our use of StrictMode
and the fact that we seem to prioritize it, leading to jumping through hoops like this.
What does StrictMode
bring us? It's a debugging tool that runs in development. It's very useful. But is it so useful that we want to implement that kind of workaround to keep it? Or may we consider disabling it when working on features that are not possible in a StrictMode
context, and then enable it again when merging to master?
I guess this has the side effect of needing a warning in the documentation on with inline comments for people wanting to run coral
locally.
I don't know what is the right solution, but I'm pretty wary of the time and effort we devote to working around StrictMode
:/
🤦 yes, of course! Will update.
I don't think having to remove We can only remove And: Even using |
e048301
to
23a7c3a
Compare
@mathieu-anderson updated the modal and example! |
23a7c3a
to
f1b9b1b
Compare
Signed-off-by: Mirjam Aulbach <[email protected]>
f1b9b1b
to
91d8e13
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
About this change - Why
Modal
from Aquarium design system usesreact-aria
, which currently does not work in React18StrictMode
.About this change - What
dialog
andaria-modal
to support assistive technologysetFocus
inModal
is removing focus and focusability from#root
while setting focus on theh1
element (it's sometimes recommended to set the focus on the first / primary action, but that leads to confusing information for screen reader users as I think, so I oped for this)inert
attribute, so in case the user agent is FF there's a special handling to trap user in modalh1
enables screen reader user (tested with VO) to access content in dialog easilyScreen recordings
Chrome (keyboard)
chrome-keyboard.mov
Chrome (voice over)
chrome-vo.mov
Firefox (keyboard)
firefox.mov
Notes about potential optimisation
Modal
css uses az-index
, since one element (FileInput
) uses one already. It would be good to add defined variables and values for z-index, otherwise this could get messy in the futureminWidth
for the modal dialog element is an arbitrary value to prevent layout breaks. It does not use a valid TW value here, but I could not find a fitting one.