-
Notifications
You must be signed in to change notification settings - Fork 21
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
proof of concept dialog element #61
Conversation
Thank you for creating this PR! Using the dialog element was an idea I didn't have, so that was refreshing! |
Hello @dc7290, All about how dialog element works can be found in issue #49 I also created for you a test page to see how the dialog can be used: I would be honored if you take a look. If you look at the source code, you will see how dead simple everything is:
I feel like the styling is also simplier, as the user can focus only on the modal content, I feel the harder part is to open or close the modal from the parent component, but maybe it's easier with a hook ? As you are better than me, you will find a clean solution, What do you think about my demo ? Have you some concerns with |
Thank you for even creating a demo! I think the idea of using the dialog element is great! One thing I was wondering about is the browser behavior regarding supported browsers and focus traps. Supported Browsers
Focus Trap
However, I thought this suggestion was well worth incorporating. |
I did some tests with my browserstack (stayed on Laptop MacOS):
As you said the main concern is the cutting-edge Safari version for users. I'll look further for Firefox backdrop. As the focus trap, isolation, centering, keyboard are managed, I feel like Here's a good article about how to build around dialog. |
Hello, My ticket stills opened, but they corrected their table about ::backdrop, it works very well so it was a mistake on their side! |
@Nayte91 Sorry for the lack of time. |
Hello @dc7290 Wonderfull! I will be the first user and fan of this new version!
Beyond that, I can only give advices/wishes about the global API, what can be enjoyable to use. Few ideas:
I feel like this kind of pattern is a bit annoying and can be optimized:
I wanted to do such a thing:
But it seems that the 'MyModalContent' must output somewhere it can be rendered, and I can't in a hook. Maybe with a global DialogContext? For the style, I think the easiest way to apply is:
example of style injection:
But it works because I use CSS modules, with nextJS. Maybe this something to try? |
Thank you!!! I'll share more when I'm able to prototype! |
Probably at the end of December. |
Here's a proof of concept : this is the bare minimum changes in order to use dialog HTML element instead of div.
Also I'm sorry but I don't know how to open a pull request on a non-existing branch on your side; so please feel free to revoke this PR and try on my side.
closes #49