-
Notifications
You must be signed in to change notification settings - Fork 37
feat: enable granular control over outside interactions for drawers and modals #1033
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
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
Bundle ReportChanges will increase total bundle size by 2.42kB (0.09%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: @tonic-ui/react-hooks-esmAssets Changed:
Files in
view changes for bundle: @tonic-ui/react-esmAssets Changed:
Files in
Files in
Files in
Files in
Files in
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## v2 #1033 +/- ##
==========================================
+ Coverage 78.32% 78.37% +0.04%
==========================================
Files 420 420
Lines 6922 6938 +16
==========================================
+ Hits 5422 5438 +16
Misses 1500 1500 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Tonic UI DemoOn 2025-06-29 13:12:12 +0000, PR #1033 (4a52ac4) was successfully deployed. You can view it at the following link: |
🦋 Changeset detectedLatest commit: 4a52ac4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
CI Feedback 🧐(Feedback updated until commit a53b1e0)A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
closeOnOutsideClick
control for drawers and modals
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
…` props to Drawer and Modal
User description
Use
onInteractOutside(event)
andcloseOnInteractOutside
instead of passing acloseOnOutsideClick
function.If
closeOnInteractOutside
is set to true, you can callevent.preventDefault()
insideonInteractOutside
to prevent the drawer/modal from closing.Reference:
https://chakra-ui.com/docs/components/dialog
PR Type
Enhancement
Description
• Add
closeOnInteractOutside
andonInteractOutside
props to Drawer and Modal• Deprecate
closeOnOutsideClick
in favor of new interaction handling• Enable granular control over outside interactions with event prevention
• Update documentation and demo pages with new API
Changes walkthrough 📝
7 files
Update drawer demo with new interaction props
Update modal demo with new interaction props
Add closeOnInteractOutside and onInteractOutside props
Implement new interaction handling with event prevention
Add closeOnInteractOutside and onInteractOutside props
Implement new interaction handling with event prevention
Refine escape key handling logic
3 files
Remove unused shouldAllRefsOutside option from comments
Update drawer API documentation
Update modal API documentation
1 files
Add focusVisible style with red border