Skip to content

Trigger onClose when Dialog backdrop is clicked - #4565

Merged
dgreif merged 2 commits into
mainfrom
dg/dialog-backdrop-click
May 8, 2024
Merged

Trigger onClose when Dialog backdrop is clicked#4565
dgreif merged 2 commits into
mainfrom
dg/dialog-backdrop-click

Conversation

@dgreif

@dgreifdgreif commented May 6, 2024

Copy link
Copy Markdown
Contributor

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 ignorebackdrop 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

@changeset-bot

changeset-botBot commented May 6, 2024

Copy link
Copy Markdown

🦋 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
NameType
@primer/reactMinor

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-actionsBottemporarily deployed to storybook-preview-4565 May 6, 2024 22:19 Inactive
@dgreif
dgreifforce-pushed the dg/dialog-backdrop-click branch from 94f7fa2 to 1107686CompareMay 6, 2024 23:15
@github-actions

github-actionsBot commented May 6, 2024

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
packages/react/dist/browser.esm.js88.1 KB (+0.08% 🔺)
packages/react/dist/browser.umd.js88.39 KB (+0.01% 🔺)

@github-actions
github-actionsBottemporarily deployed to storybook-preview-4565 May 6, 2024 23:19 Inactive
@github-actions
github-actionsBottemporarily deployed to storybook-preview-4565 May 6, 2024 23:27 Inactive
@dgreif
dgreif marked this pull request as ready for review May 6, 2024 23:35
@dgreif
dgreif requested a review from a team as a code ownerMay 6, 2024 23:35
@dgreif
dgreif requested a review from broccolinisoupMay 6, 2024 23:35
@dgreifdgreif self-assigned this May 7, 2024
@dgreif
dgreif added this pull request to the merge queueMay 8, 2024
Merged via the queue into main with commit 564db1dMay 8, 2024
@dgreif
dgreif deleted the dg/dialog-backdrop-click branch May 8, 2024 21:04
@primerprimerBot mentioned this pull request May 8, 2024
joshblack added a commit that referenced this pull request May 10, 2024
github-merge-queueBot 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
@joshblack
joshblack restored the dg/dialog-backdrop-click branch May 20, 2024 18:11
Sign up for freeto 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.

2 participants

@dgreif@joshblack