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

Trigger onClose when Dialog backdrop is clicked #4565

Merged
merged 2 commits into from May 8, 2024

Conversation

dgreif
Copy link
Member

@dgreif dgreif commented May 6, 2024

Relates to https://github.com/github/primer/issues/2531
Relates to https://github.com/github/repos/issues/9248
Alternative to https://github.com/github/primer/issues/1838

I'd like to allow the v2 Dialog to be closed by clicking on the backdrop overlay. This is currently not supported, though the v1 Dialog and PVC dialog support this behavior.

Based on the usage guidelines, there are some unique cases where clicking the backdrop should not close the dialog. By passing in a new backdrop gesture, there is an escape hatch for these unique cases to ignore backdrop events on a case-by-case basis.

Changelog

New

Dialog and ConfirmationDialog can now be closed by clicking on the backdrop round the dialog. This will cause onClose to be called with a new 'backdrop' gesture.

Changed

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

Copy link

changeset-bot bot commented May 6, 2024

🦋 Changeset detected

Latest commit: 1645a6b

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

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

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

@github-actions github-actions bot temporarily deployed to storybook-preview-4565 May 6, 2024 22:19 Inactive
Copy link
Contributor

github-actions bot commented May 6, 2024

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 88.1 KB (+0.08% 🔺)
packages/react/dist/browser.umd.js 88.39 KB (+0.01% 🔺)

@github-actions github-actions bot temporarily deployed to storybook-preview-4565 May 6, 2024 23:19 Inactive
@dgreif dgreif added this pull request to the merge queue May 8, 2024
Merged via the queue into main with commit 564db1d May 8, 2024
31 checks passed
@dgreif dgreif deleted the dg/dialog-backdrop-click branch May 8, 2024 21:04
@primer primer bot mentioned this pull request May 8, 2024
joshblack added a commit that referenced this pull request May 10, 2024
github-merge-queue bot pushed a commit that referenced this pull request May 13, 2024
JelloBagel pushed a commit that referenced this pull request May 16, 2024
* Trigger onClose when Dialog backdrop is clicked

* Update docs with new backdrop gesture
JelloBagel pushed a commit that referenced this pull request May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants