-
Notifications
You must be signed in to change notification settings - Fork 44
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
Modal
- Fix functionality for isDismissDisabled
#2485
Conversation
…bled` functionality
…al` backing class
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
As a background, the Flyout component was not meant to have an |
@alex-ju my bad, I saw |
Modal
and Flyout
functionalities for isDismissDisabled
Modal
- Fix functionality for isDismissDisabled
1a6ae09
to
6dd0f83
Compare
@alex-ju FYI I have opened a bug in Jira for a related issue I've found: https://hashicorp.atlassian.net/browse/HDS-3972 |
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.
Thanks for looking into this and recording the related issue in Jira! Great addition to the showcase
as well.
--- | ||
|
||
`Modal` - Fixed `isDismissDisabled` functionality | ||
`Flyout` - Removed `isDismissDisabled` from signature (not an actual argument) |
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.
👍
@alex-ju thanks for the prompt review. I'm going to merge it now. One consideration: while technically this is just a patch, a bug fix, in practice it may lead to "breaking" changes in the consumers if their implementation in code was not correct. Essentially, since our implementation was not updating the value once set at initial render, the modal were actually dismissable even if the value of
I don't know if you want to do some tests before doing the actual HDS version upgrade in these consumers. Probably an overkill, but given our recent struggle with the HDS version update, something to consider. |
I am planning to test in products before releasing, so thanks for pointing to the current instances for this change. |
📌 Summary
While working on the
ChallengeModal
component for HDS+ (https://github.com/hashicorp/hds-plus/pull/32) I started to test if it was possible to use the@isDismissDisabled
argument to disable the dismiss of the modal while the content of the form was being validated (and potentially the consumer-side execution completed).I checked in our HDS showcase, and I noticed that there were no specific demos for this functionality, so I started a new branch to add a scenario for this. While testing the use case, I noticed it didn't work, so I found that there was a bug, and I started to fix it.
I then looked at theFlyout
component, which is very similar, and I noticed that this functionality was completely missing (despite exposing and documenting a@isDismissDisabled
argument). We (well, I) missed this "detail" in this code review: https://github.com/hashicorp/design-system/pull/1887/files.After conversation with @alex-ju I've removed the previous commits.
This PR aims to have the functionality work as expected in both components, and have it covered in the showcase and in the integration tests.
🛠️ Detailed description
In this PR I have:
Modal
to testisDismissDisabled
functionality (used to TDD)Modal
backing class (as agreed before)isDismissDisabled
from tracked variable to getter inModal
backing class (this was the bug: essentially once the component was rendered the value of the trackedthis.isDismissDisabled
variable was not updated, even if the argument was updated, so I had to use a getter instead of a tracked variable)isDismissDisabled
functionality forModal
👀 Preview: https://hds-showcase-git-showcase-modal-flyout-isdismi-67f0a4-hashicorp.vercel.app/components/modal
📸 Screenshots
Before:
before.mov
After:
after.mov
👀 Component checklist
💬 Please consider using conventional comments when reviewing this PR.