Skip to content

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

Merged
jcfranco merged 7 commits intodevfrom
jcfranco/9559-fix-open-close-util-regression
Jun 12, 2024
Merged

fix: fix regression causing open/close events from emitting in proper order#9560
jcfranco merged 7 commits intodevfrom
jcfranco/9559-fix-open-close-util-regression

Conversation

@jcfranco
Copy link
Copy Markdown
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
Copy Markdown
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 👍

import { whenTransitionDone } from "./dom";

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

Choose a reason for hiding this comment

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

🥼 🔬

so we fall back to it if there's no matching prop duration */
allDurationsArray[0];

function startEndImmediately(): void {
Copy link
Copy Markdown
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
@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
@benelan benelan mentioned this pull request Aug 28, 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.

2 participants