-
Notifications
You must be signed in to change notification settings - Fork 50
Modal
- Revert fixes #2846 and #2902
#2964
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 ↗︎
|
📦 RC Packages PublishedLatest commit: 48c8ecc Published 2 packages@hashicorp/design-system-components@4.20.2-rc-20250620133756
@hashicorp/flight-icons@3.11.1-rc-20250620133756
|
c245493
to
a79c86e
Compare
looking at #2846, it doesn't just improve accessibility, it fixes a functional issue with click outside the Modal not working properly when so by simply reverting it we're bringing back a functional issue – @shleewhite may be able to keep me honest here – we could make the call of moving forward, but want to make sure it's a conscious decision |
f3a2f5a
to
815d901
Compare
815d901
to
61fbecf
Compare
61fbecf
to
ba2ae3f
Compare
Per discussion amongst us (@alex-ju @shleewhite @didoo): we’ve decided that it would be safer/quicker to use the PR where we revert the changes introduced with the two previous fixes, because 1) we know that the code worked before and 2) the only issue, the original one that was being fixed, was reported by us and was a very specific edge case (click outside when the modal is not dismissible - see HDS-3972) We’ve also decided to split in two the PRs, so we have a very simple PR for reverting things, and one for the showcase updates and the integration tests refactoring (see #2966). |
ba2ae3f
to
7c9aef3
Compare
This doesn't need to be a blocker for this PR, but for the examples deactivating on destroy and deactivating on form submit the focus is not getting reset back to the button after the modal is removed. In the on close example the focus is being reset. This is because Using the Overall the fix looks to be working great though. Didn't see any issues with scrolling being disabled. |
I noticed that too @dchyun. The intention here is to provide a clean revert addressing the issue at hand, rather than a comprehensive fix – for now – and review the component for improvements in the coming days. We have a few potential ways to improve the component and clarify some of the actions. |
📌 Summary
This PR reverts the fixes made in #2846 and #2902 that introduced an unexpected side-effect.
When the Modal was not closed via the "manual" dismiss (click outside, click dismiss button, esc key) or the
F.Close
yielded method, the code that cleans up theoverflow: hidden
from the<body>
element is run inside theonDismiss
function. When the modal is simply destroyed and removed from the DOM (eg. on submit) theonDismiss
is not run, just thewillDestroyNode
method, which leaves the overflow applied to the body, making the page unscrollable.We've decided that, even if we have other fixes to the bug (see #2961 and #2962), this is the safest and quickest route. After the release, we will discuss and decide how to reintroduce the original/intended changes (for better accessibility) in a safe and controlled way (that would likely include a refactoring of the existing code to make it easier to follow the logic flow and debug if necessary)
You can see examples of this bug in the linked Jira ticket.
🛠️ Detailed description
In this PR I have:
Modal
: fix issue with click outside to dismiss #2846Modal
: remove click listener properly #2902 (but left the integration test that was added)The updates to the showcase and the integration tests are done in a different PR (#2966) to keep this one very simple and straightforward.
📸 Screenshots
Modal:
https://github.com/user-attachments/assets/4a681e64-9f50-4a59-9001-b7cab3525f4c
Flyout:
https://github.com/user-attachments/assets/3c34dfe5-f503-4bf2-9cd6-694ccc06e692
🔗 External links
Jira ticket: https://hashicorp.atlassian.net/browse/HDS-4975
Related PRs:
Modal
issues #2961👀 Component checklist
💬 Please consider using conventional comments when reviewing this PR.
📋 PCI review checklist
Examples of changes to controls include access controls, encryption, logging, etc.
Examples include changes to operating systems, ports, protocols, services, cryptography-related components, PII processing code, etc.