-
-
Notifications
You must be signed in to change notification settings - Fork 300
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
Use "inert" for Modal and Drawer to keep focus contained #1655
Comments
Adding a reference to the prior PR which this will replace: |
What's the plan for this PR, I understood once this gets the green light I could implement this? |
@Hugos68 we'll circle back. Right now my priorities are elsewhere. But we don't keep tickets that we don't plan to move forward on. Last we left off I believe the plan was to create a standalone proof of concept of the portal feature. Then determine if that's something we want to implement as a dedicated feature in Skeleton - as it might have multiple applications. Once that's in place, we can look to update our modal system to use this + the I'd welcome help with either part of those. |
Sounds good, not sure if you noticed but there is a proof of concept repo that showcases the |
Great, send me a link here please |
This is a standalone minimal repo: https://github.com/Hugos68/modal-drawer-inert-sample-project |
@endigo9740 What should we do with this? I am scanning through the issues FYI. |
@Hugos68 this will be bumped to v3 milestone later this week ;) |
In an effort to prepare for Skeleton v3, we're consolidate some related issues down to a single ticket. This will ensure that we can see the full context of requests when the time comes to refactor and update this feature going forward. If you wish to add additional feedback or suggestions, please so here: |
Describe the feature in detail (code, mocks, or screenshots encouraged)
By using
inert
you can make a DOM element and it's descendants un-interactive-able which can come in handy when implementing overlays like Modals and Drawers. By puttinginert
on the %sveltekibody% surroundingdiv
and placing the Modal and Drawer element besides that div we can disable interactions for the entire app on demand whilst having a overlay active on top.Here is a small demo.
As shown in the project we can utilize the
portal
action to rerender any element in a different place.Because I am working on my own headless component library I went ahead and implemented it aswell, it can be found here if you want to see it in action.
This is what the structure of the
<body>
will look like when implemented:Modal/Drawer Hidden:
Modal/Drawer Visible:
This would also indirectly fix: #1613
What type of pull request would this be?
New Feature
Provide relevant links or additional information.
This feature was discussed prior to me making this issue, the full conversation can be read about here: https://discord.com/channels/1003691521280856084/1003699523522142399/1116800227148566558
The text was updated successfully, but these errors were encountered: