-
Notifications
You must be signed in to change notification settings - Fork 50
Modal
: fix issue with click outside to dismiss
#2846
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
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
It's quite a complex PR with potential side-effects. Maybe @RobbieTheWagner could review it too? |
Have you considered moving the logic out of the modal and into a global |
I like this idea. FWIW, there is a well maintained addon for this, if we want to just use that https://github.com/lifeart/ember-click-outside-modifier |
@RobbieTheWagner @zamoore This is definitely an interesting idea... I think for now because there really is only one use so far I'm leaning towards leaving the one off implementation. We usually rely on |
Co-authored-by: Melanie Sumner <melanie@hashicorp.com>
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.
LGTM! Only suggestion, should we add a test case for the document click in the existing isDIsmissDisabled
test?
📌 Summary
If merged this PR would update Modal to not use
ember-focus-trap
to dismiss the Modal on click outside and instead use our own click event.It also fixes an issue where the scroll bar would get added back if try to close the modal when
isDismissDisabled=true
.🛠️ Detailed description
This is necessary because the
ember-focus-trap
'sclickOutSideDeactivates
only ever runs once. If a consumer conditionally disables the ability to dismiss the modal, the user may not be able to click outside to deactivate it.Steps to reproduce:
🔗 External links
Jira ticket: HDS-3972
👀 Component checklist
💬 Please consider using conventional comments when reviewing this PR.