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

New: event handler for CSS transitions #537

Merged
merged 6 commits into from
May 29, 2024
Merged

New: event handler for CSS transitions #537

merged 6 commits into from
May 29, 2024

Conversation

danielghost
Copy link
Contributor

Fixes #533.

New

  • Handler to await completion of active CSSTransitions at point of execution.

@danielghost danielghost added the enhancement New feature or request label May 15, 2024
@danielghost danielghost self-assigned this May 15, 2024
@danielghost
Copy link
Contributor Author

danielghost commented May 15, 2024

This only concentrates on CSSTransition. Animation and CSSAnimation are different enough for these to be handled separately, and it becomes more difficult to identify when all are complete if mixed together due to their quirks.

One point of contention with this code is that it currently only tracks transitions which are yet to have run. This is to prevent early completion where transitions applied by another plugin may have ended before new ones have run - only an issue if the element is using transition-property: 'all', there may be a better way of handling this issue.

js/transitions.js Outdated Show resolved Hide resolved
js/transitions.js Outdated Show resolved Hide resolved
js/transitions.js Outdated Show resolved Hide resolved
…ns which did/will not run. Removed dependency on only tracking transitions run at point of execution, as the use case for this was due to an issue with external code instead.
danielghost and others added 2 commits May 15, 2024 21:38
* Review

* Restore exports

* Reordered functions for better changes log

* Updated comments

* Clarified main use-case of timeout and onEnd functions

---------

Co-authored-by: Dan Ghost <daniel.ghost@kineo.com>
Copy link
Member

@oliverfoster oliverfoster left a comment

Choose a reason for hiding this comment

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

👀

…irst item if returns an array of selectors.
Copy link
Contributor

Choose a reason for hiding this comment

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

👀

Copy link
Contributor

@kirsty-hames kirsty-hames left a comment

Choose a reason for hiding this comment

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

Tested with List PR and this works as expected thanks.

@oliverfoster oliverfoster merged commit 9329b65 into master May 29, 2024
@oliverfoster oliverfoster deleted the issue/533 branch May 29, 2024 11:50
github-actions bot pushed a commit that referenced this pull request May 29, 2024
# [6.47.0](v6.46.11...v6.47.0) (2024-05-29)

### New

* event handler for CSS transitions (#537) ([9329b65](9329b65)), closes [#537](#537)
@oliverfoster
Copy link
Member

🎉 This PR is included in version 6.47.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a transition event handler for CSS transitions
4 participants