-
Notifications
You must be signed in to change notification settings - Fork 84
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
feat(click-away-wrapper): add ClickAwayWrapper component to internal directory #5188
Conversation
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. Latest deployment of this branch, based on commit 5c38e7f:
|
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
cd23fa4
to
cb1c4e1
Compare
src/__internal__/click-away-wrapper/click-away-wrapper.spec.tsx
Outdated
Show resolved
Hide resolved
18220fa
to
9f56b2a
Compare
…directory Adds `ClikcAwayWrapper` component to handle triggering an action if a mousedown event is detected outside of it
9f56b2a
to
3b09573
Compare
🎉 This PR is included in version 107.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Proposed behaviour
Adds
ClickAwayWrapper
component to handle triggering an action if a mousedown/ click event is detectedoutside of it
Adds the
ClickAwayWrapper
to enable thePopoverContainer
to close when amousedown
event isdetected from outside of the wrapper boundaries
Adds
ClickAwayWrapper
toDate
andSubmenu
as wellfix #5017, fix #5158
Current behaviour
No
ClickAwayWrapper
component exists.PopoverContainer
does not close when click is outside of it.Date
andSubmenu
have their own implementations to handle closing when click outside occursChecklist
d.ts
file added or updated if requiredQA
Additional context
Testing instructions
Test Date, Submenu and PopoverContainer stories, clicking inside should not close the components but clicking outside should
The following CodeSandbox is an example of the broken behaviour.
You can see the new behaviour by looking at the version in the comment by
codesandbox[bot]
.https://codesandbox.io/s/mystifying-northcutt-c3slyx?file=/src/index.js