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

fix: fix regression causing open/close events from emitting in proper order #9560

Merged
merged 7 commits into from
Jun 12, 2024

Conversation

jcfranco
Copy link
Member

@jcfranco jcfranco commented Jun 11, 2024

Related Issue: #9559

Summary

This fixes openCloseComponent.onToggleOpenCloseComponent to emit beforeOpen/Close events when the associated transition starts and emits open/close when the transition ends.

This regression was introduced by #9341 and would cause beforeOpen/open or beforeClose/close to emit immediately after another after the transition was done.

Notable changes

  • adds spec test to add coverage for onToggleOpenCloseComponent
  • enhances whenAnimationDone/whenTransitionDone to accept callbacks for both start and end phases
  • exposes readTask from openCloseComponent to allow for stubbing (stubbing Stencil's utility is not possible because the core module getters are non-configurable)
  • extracts animation/transition helpers for spec tests to individual modules

@jcfranco jcfranco added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Jun 11, 2024
@github-actions github-actions bot added the bug Bug reports for broken functionality. Issues should include a reproduction of the bug. label Jun 11, 2024
@jcfranco jcfranco added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Jun 11, 2024
@jcfranco jcfranco marked this pull request as ready for review June 11, 2024 23:41
@jcfranco jcfranco requested a review from a team as a code owner June 11, 2024 23:41
Copy link
Member

@driskull driskull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

@@ -1,6 +1,11 @@
import { readTask } from "@stencil/core";
import { whenTransitionDone } from "./dom";

/**
* Exported for testing purposes only
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥼 🔬

@@ -702,8 +720,14 @@ export async function whenTransitionOrAnimationDone(
so we fall back to it if there's no matching prop duration */
allDurationsArray[0];

function startEndImmediately(): void {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jcfranco jcfranco added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Jun 12, 2024
@jcfranco jcfranco added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Jun 12, 2024
@jcfranco jcfranco merged commit fa5b415 into dev Jun 12, 2024
12 checks passed
@jcfranco jcfranco deleted the jcfranco/9559-fix-open-close-util-regression branch June 12, 2024 04:16
@github-actions github-actions bot added this to the 2024-06-25 - Jun Release milestone Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug reports for broken functionality. Issues should include a reproduction of the bug. pr ready for visual snapshots Adding this label will run visual snapshot testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants