-
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
[Modal]: Support nested modals #14104
Comments
after discussing this issue in the previous DSAG meeting i've gone ahead and started a mural for solution exploration https://app.mural.co/invitation/mural/watsonassistant2719/1688405516721?sender=dmenend6705&key=ab296ce7-8698-4423-a824-df2c130e2065 |
@davidmenendez could you outline what the hard blockers are currently with nested modals? |
@tay1orjones for IBM Products it's pretty simple. The From a technical aspect i don't see any reason why modals couldn't be stacked on top of each other. Obviously there are plenty of design / UX concerns and questions around this type of interaction, but it's my opinion that this is a design / UX problem and not a technical one. I'm working on a proof of concept PR with changes to |
Next steps: @davidmenendez collect usage examples of this. Ex. A modal on top of a tearsheet... might be the exception to nesting modals. |
@davidmenendez Yeah that makes sense. It's been suggested that we could refactor modal to use the native All this to say I think it's worthwhile to remove any technical blockers that might be in place preventing folks from doing this, despite the UX concerns and debate. |
@tay1orjones yes i just saw that! funnily enough i just opened a PR to demonstrate some small changes that would be necessary to enable this support. i'm happy to discuss what are options are and continue to fine tune these changes. and yes, believe me, we've debated this to death. but hey the user is never wrong, right? 😂 |
The problem
Currently it's not possible to nest a modal within a modal without causing breaking problems. While we can and have argued that modals shouldn't be nested within modals, that hasn't stopped users from doing it and then opening issues about it. This is especially true for carbon for ibm products which extends modal several times. The biggest point of contention being with the Tearsheet component where we have seen numerous complaints and bug reports regarding the inability to use a modal within tearsheet. And yes you could argue (and we have) that if you're using Tearsheet in a way that requires an additional modal that perhaps a tearsheet isn't the ideal solution for you or your product, that still hasn't stopped it from happening.
So, I'm here to advocate for a look at the current modal code to see if we can make adjustments so that nesting modals is possible. I'm also here to offer my services to fix this problem personally.
The solution
After examining the modal code I believe the main problem can be addressed by making some adjustments to the structure of modal and how certain events like onClose are triggered.
Examples
No response
Application/PAL
https://github.com/carbon-design-system/ibm-products/tree/main
Business priority
None
Available extra resources
as a developer i'd be more than happy to try to tackle this
Code of Conduct
The text was updated successfully, but these errors were encountered: