Skip to content

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

@changeset-bot
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

@dgreif dgreif temporarily deployed to github-pages May 6, 2024 22:18 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-4565 May 6, 2024 22:19 Inactive
@dgreif dgreif force-pushed the dg/dialog-backdrop-click branch from 94f7fa2 to 1107686 Compare May 6, 2024 23:15
@dgreif dgreif temporarily deployed to github-pages May 6, 2024 23:18 — with GitHub Actions Inactive
@github-actions
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
@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
@joshblack joshblack restored the dg/dialog-backdrop-click branch May 20, 2024 18:11
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.

3 participants