Skip to content

feat(dialog): add "reason" for why dialog is about to close to event detail #875

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

Merged
merged 3 commits into from
Mar 31, 2025

Conversation

DRiFTy17
Copy link
Collaborator

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added/updated: Y
  • Docs have been added/updated: Y
  • Does this PR introduce a breaking change? N
  • I have linked any related GitHub issues to be closed when this PR is merged? N

Describe the new behavior?

The forge-dialog-before-close custom event will now contain an object in its detail property that provides the reason as to why the dialog is closing. This event will dispatch whenever a light dismiss action occurs (which will provide whether the escape key was pressed or the backdrop was clicked to trigger the light dismiss), or when the dialog is closed via formmethod="dialog" submission.

Additional information

This primarily exposes the ability for developers to handle light dismiss actions differently whether that is triggered via escape key press or backdrop click, and potentially handle those to actions differently if desired.

Ideally light dismiss should be controlled via persistent as a whole, but there may be scenarios where handling each action differently is necessary.

@DRiFTy17 DRiFTy17 added minor Increment the minor version when merged skip-release Preserve the current version when merged labels Mar 21, 2025
@DRiFTy17 DRiFTy17 requested a review from a team as a code owner March 21, 2025 17:23
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@DRiFTy17 DRiFTy17 merged commit 8e503da into main Mar 31, 2025
7 checks passed
@DRiFTy17 DRiFTy17 deleted the dialog-before-close-reason branch March 31, 2025 23:54
Copy link
Contributor

github-actions bot commented Apr 3, 2025

🚀 PR was released in v3.8.0 🚀

@github-actions github-actions bot added the released This issue/pull request has been released. label Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Increment the minor version when merged released This issue/pull request has been released. skip-release Preserve the current version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants