Skip to content

fix(dialog): revert close event timing to dispatch immediately [BREAKING CHANGE] #5633

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Rajdeepc
Copy link
Contributor

Description

This PR reverts the breaking change introduced in SWC 1.0.3 PR #4937 that moved the close event dispatch from immediate to post-animation completion. The change was causing issues for applications that rely on immediate close event handling, such as route changes and state cleanup.

Problem

The previous change in PR #4937 moved the close event to fire after animations complete, which:

  • Breaks applications expecting immediate event handling
  • Prevents route changes from happening when users click close
  • Delays state cleanup and navigation preparation

Solution

Revert the close event timing to dispatch immediately when dialog.close() is called, while maintaining proper animation coordination through the existing sp-closed event from the overlay system.

Changes Made

  • DialogBase.ts:
    • Modified close() method to dispatch close event immediately
    • Removed post-animation close event dispatch from update() method
    • Cleaned up unused methods (dispatchClosed, hasTransitionDuration)

Breaking Change

This is a breaking change that reverts the previous breaking change from SWC 1.0.3. Applications that were updated to work with the delayed close event timing will need to be updated to handle immediate close events again.

Related issue(s)

Screenshots (if appropriate)


Author's checklist

  • I have read the CONTRIBUTING and PULL_REQUESTS documents.
  • I have reviewed at the Accessibility Practices for this feature, see: Aria Practices
  • I have added automated tests to cover my changes.
  • I have included a well-written changeset if my change needs to be published.
  • I have included updated documentation if my change required it.

Reviewer's checklist

  • Includes a Github Issue with appropriate flag or Jira ticket number without a link
  • Includes thoughtfully written changeset if changes suggested include patch, minor, or major features
  • Automated tests cover all use cases and follow best practices for writing
  • Validated on all supported browsers
  • All VRTs are approved before the author can update Golden Hash

Manual review test cases

  • Descriptive Test Statement

    1. Go here
    2. Do this action
    3. Expect this result
  • Descriptive Test Statement

    1. Go here
    2. Do this action
    3. Expect this result

Device review

  • Did it pass in Desktop?
  • Did it pass in (emulated) Mobile?
  • Did it pass in (emulated) iPad?

Copy link

changeset-bot bot commented Jul 24, 2025

⚠️ No Changeset found

Latest commit: 711eedb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Rajdeepc Rajdeepc self-assigned this Jul 24, 2025
@Rajdeepc Rajdeepc changed the title fix(dialog): revert close event logic fix(dialog): revert close event timing to dispatch immediately [BREAKING CHANGE] Jul 24, 2025
Copy link

📚 Branch Preview

🔍 Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Deployed to Azure Blob Storage: pr-5633

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

Copy link

Tachometer results

Currently, no packages are changed by this PR...

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.

1 participant