Skip to content
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

fix(pie-modal): DSW-2218 stop esc closing modal (isDismissible=false) #1975

Merged
merged 3 commits into from
Oct 9, 2024

Conversation

jamieomaguire
Copy link
Contributor

@jamieomaguire jamieomaguire commented Oct 9, 2024

Describe your changes (can list changeset entries if preferable)

  • Prevents Escape key presses from closing the modal when iDismissible is set to false
  • Applies the same protection against reactive changes to the isDismissible property
  • Enables the previously skipped test that captured the bug

How to test

  1. Go to the default Modal story in the Storybook preview deploy
  2. Try pressing escape
  3. The Modal should close
  4. Now set the isDismissible control to false
  5. Try pressing escape
  6. The Modal should not close
  7. Try various combinations to see if lifecycle changes affect the behaviour (they don't when I have tested but worth a second person checking)

Author Checklist (complete before requesting a review)

  • I have performed a self-review of my code
  • I have added thorough tests where applicable (unit / component / visual)
  • I have reviewed the PIE Storybook PR preview
  • I have reviewed visual test updates properly before approving
  • If changes will affect consumers of the package, I have created a changeset entry.
  • If a changeset file has been created, I have used the /snapit functionality to test my changes in a consuming application

Reviewer checklists (complete before approving)

Reviewer 1 - Fernando

  • I have reviewed the PIE Storybook PR preview

Reviewer 2 - @xander-marjoram

  • I have reviewed the PIE Storybook PR preview

Copy link

changeset-bot bot commented Oct 9, 2024

🦋 Changeset detected

Latest commit: 7c0d0de

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@justeattakeaway/pie-modal Minor
pie-storybook Patch
@justeattakeaway/pie-cookie-banner Patch
@justeattakeaway/pie-webc Patch
wc-angular12 Patch
wc-next10 Patch
wc-next13 Patch
wc-nuxt2 Patch
wc-nuxt3 Patch
wc-react17 Patch
wc-react18 Patch
wc-vanilla Patch
wc-vue3 Patch

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

@jamieomaguire jamieomaguire force-pushed the dsw-2218-modal-esc-bug branch from 93961ea to c55a66b Compare October 9, 2024 12:14
fernandofranca
fernandofranca previously approved these changes Oct 9, 2024
@jamieomaguire jamieomaguire marked this pull request as ready for review October 9, 2024 14:10
@jamieomaguire jamieomaguire requested review from a team as code owners October 9, 2024 14:10
@jamieomaguire
Copy link
Contributor Author

/test-aperture

@pie-design-system-bot
Copy link
Contributor

Starting a new snapshot build. You can view the logs here.

@pie-design-system-bot
Copy link
Contributor

@jamieomaguire Your snapshots have been published to npm!

Test the snapshots by updating your package.json with the newly-published versions:

Note

If you have more than one of these packages installed, we suggest using the new snapshots for all of them to help avoid version conflicts.

yarn up @justeattakeaway/[email protected] --mode=update-lockfile
yarn up @justeattakeaway/[email protected] --mode=update-lockfile
yarn up @justeattakeaway/[email protected] --mode=update-lockfile

Then finally:

yarn install

@jamieomaguire
Copy link
Contributor Author

/test-aperture

@pie-design-system-bot
Copy link
Contributor

Starting a new snapshot build. You can view the logs here.

@pie-design-system-bot
Copy link
Contributor

@jamieomaguire Your snapshots have been published to npm!

Test the snapshots by updating your package.json with the newly-published versions:

Note

If you have more than one of these packages installed, we suggest using the new snapshots for all of them to help avoid version conflicts.

yarn up @justeattakeaway/[email protected] --mode=update-lockfile
yarn up @justeattakeaway/[email protected] --mode=update-lockfile
yarn up @justeattakeaway/[email protected] --mode=update-lockfile

Then finally:

yarn install

Copy link
Contributor

@fernandofranca fernandofranca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 👏 👏

@jamieomaguire jamieomaguire merged commit e921c5e into main Oct 9, 2024
43 of 47 checks passed
@jamieomaguire jamieomaguire deleted the dsw-2218-modal-esc-bug branch October 9, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants