-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
experiment: native dialog component #15926
experiment: native dialog component #15926
Conversation
✅ Deploy Preview for v11-carbon-react ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
The following branch contains nested dialogs. This appears to be problematic for various styling reasons:
https://github.com/lee-chase/carbon/tree/nativeDialogNest |
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.
Thanks so much for looking into this, I agree - it answers quite a few questions!
The tooltip on the close button appears on top of the modal as intended, so that's great news. Once we get the autoAlign stuff in I'll be eager to test how it works with this.
I have a few other thoughts below. I wouldn't be opposed to eventually merging this in, not exporting it for now, and hiding the stories from the storybook. I think it's valuable to keep this on deck and continue to experiment, and merging it in would avoid PRs sitting around getting stale.
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.
I think this puts the Dialog component on a much better track than it was previously! I still think we should keep it internal-only at this point and not export it or include it in storybook. If those changes are made I'd personally love to see this merged.
From here we can continue to iterate on this and explore the extra areas like building a new Modal implementation atop it, etc.
Co-authored-by: Taylor Jones <[email protected]>
@tay1orjones accepted/made changes to remove from storybook. |
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.
I know it's silly but I'm genuinely excited about this one 😄
Native elements and standards feel so good.
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.
Thanks for adding this 🥳
00bbf9e
This adds an
unstable_dialog
component.Created while investigating the possibility of creating a dialog component based on native dialog.
I included a side panel and tearsheet kind as part of the experiment.
Previously some questions have been raised here, perhaps it can be used to answer some of them.
#13807
Of note is that the
modal
form blocks the whole page. The modal dialogs can be nested.Also quite a bit of the code added was to cope with the lack of support for
Unfortunately needed quite a bit of code to cope with the lack of support for some of the in/out styling
https://caniuse.com/mdn-css_at-rules_starting-style
https://caniuse.com/mdn-css_properties_display_is_transitionable
This much simpler code pen achieves a similar effect in Chrome and Edge
https://codepen.io/lee-chase/pen/QWPbRLp/9c8c3f23b42a395dc519839e12f5d647
NOTE: Use of
:where([data-attri="xyz"])
done to see how it compares with BEM modifier overload.:where
keeps the specificity low.