Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Skip animation for certain child elements #147

Unanswered
AnnaYuS asked this question in Q&A
Discussion options

Thanks for the awesome animation package!

I need to skip animations for a tooltip, so i'm trying to find a nice way to do it. This issue kind of gives an answer, but i have a follow up question

I've tried out @andrew-boyd solution with returning empty keyframes, but this removes animation for all the actions too. I ended up taking default keyframes from the source code, then it worked:

autoAnimate(parent, (el, action, oldCoords, newCoords) => {
 // Do not animate tooltip
 if (el.hasAttribute('data-tippy-root')) {
 return new KeyframeEffect(el, [])
 }
 let keyframes
 // Use default animation settings from @formkit/auto-animate source code
 if (action === 'add') {
 keyframes = [
 ...
 ]
 }
 if (action === 'remove') {
 keyframes = [
 ...
 ]
 }
 if (action === 'remain') {
 ...
 keyframes = [start, end]
 }
 return new KeyframeEffect(el, keyframes, { duration: 250, easing: 'ease-in-out' })
 })
}

it seems like it could be done in an easier way. Maybe someone could help? Is there a way to "continue" with the defaults instead of overriding them?

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /