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: Close Dialog without submit #1547

Merged
merged 6 commits into from
Aug 29, 2024
Merged

Conversation

alimpens
Copy link
Contributor

@alimpens alimpens commented Aug 28, 2024

Describe the pull request

Thank you for contributing to the project!
Please use this template to help us handle your PR smoothly.

What

This changes the Dialog close button from type="submit" to type="button", and uses JS to close the Dialog.

Why

We received an issue noting that using the Dialog close button triggers a submit event, which it shouldn't.

How

By changing the Dialog close button from type="submit" to type="button", and using and exporting a JS function to close the nearest modal.

Checklist

Before submitting your pull request, please ensure you have done the following. Check each checkmark if you have done so or if it wasn't necessary:

  • Add or update unit tests
  • Add or update documentation
  • Add or update stories
  • Add or update exports in index.* files
  • Start the PR title with a Conventional Commit prefix, as explained here.

Additional notes

  • JSDom doesn't fully support dialog, so this functionality isn't tested.

@alimpens alimpens changed the base branch from develop to main August 28, 2024 10:51
storybook/src/components/Dialog/Dialog.docs.mdx Outdated Show resolved Hide resolved
packages/react/src/Dialog/Dialog.tsx Outdated Show resolved Hide resolved
packages/react/src/Dialog/Dialog.tsx Outdated Show resolved Hide resolved
packages/react/src/Dialog/Dialog.tsx Outdated Show resolved Hide resolved
packages/react/src/Dialog/index.ts Outdated Show resolved Hide resolved
Co-authored-by: Vincent Smedinga <[email protected]>
@github-actions github-actions bot temporarily deployed to demo-close-dialog-without-submit August 29, 2024 08:55 Destroyed
alimpens and others added 2 commits August 29, 2024 10:55
Co-authored-by: Vincent Smedinga <[email protected]>
Co-authored-by: Vincent Smedinga <[email protected]>
@github-actions github-actions bot temporarily deployed to demo-close-dialog-without-submit August 29, 2024 08:58 Destroyed
@alimpens alimpens merged commit d9cc107 into main Aug 29, 2024
6 checks passed
@alimpens alimpens deleted the hotfix/close-dialog-without-submit branch August 29, 2024 11:11
@github-actions github-actions bot mentioned this pull request Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants