question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FEATURE] zIndex delay transition

See original GitHub issue

Is your feature request related to a problem? Please describe. I’m trying to build a dropdown selection, which changes z-index property depending on its state. But I cannot figure out a way to delay transition for z-index in some case, like this

Screen Recording 2019-08-02 at 3 05 44 PM

This is my variant

const popoverVariant = {
  expand: {
    height: 'auto',
    zIndex: 1,
    transition: {
      height: {
        ease: [0.4, 0.0, 0.2, 1],
        duration: 0.3,
      },
    },
  },
  collapse: {
    height: 40,
    zIndex: 'auto',
    transition: {
      height: {
        ease: [0.4, 0.0, 0.2, 1],
        duration: 0.25,
      },
      zIndex: {
        delay: 1,
      },
    },
  },
}

Describe the solution you’d like Maybe step-end easing function can help

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7

github_iconTop GitHub Comments

5reactions
nbolivercommented, Mar 10, 2022

@mattgperry How do you change the z-index with a layout animation? It should be higher during the animation and then return to normal / default on transitionEnd. I set it up like :

style={{ zIndex: 10 }}
animate={{ transitionEnd: { zIndex: 0 } }}
layoutId={`project-image-${slug}`}

but it just jumps to 0 immediately.

2reactions
mattgperrycommented, Aug 27, 2019

You can use transitionEnd to set a value at the end of an animation

https://codesandbox.io/s/framer-motion-sandbox-p9gxv

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS3 Transitions - How to delay reset of the z-index property?
Use transition-delay . You can make it so it rises on hover but waits a while before sinking on hover out by assigning...
Read more >
transition-delay - CSS: Cascading Style Sheets | MDN
The transition-delay CSS property specifies the duration to wait before starting a property's transition effect when its value changes.
Read more >
CSS3 transitions and z-index - Zoe Mickley Gillenwater
So, if I have an element with a z-index value of 1 and I want to gradually get to 10 , the browser...
Read more >
transition-delay | CSS-Tricks
When a transition has a delay value that is negative, it will cause the transition to begin immediately (with no delay), however, the...
Read more >
CSS transition-delay Property - W3Schools
CSS transition-delay Property ; Version: CSS3 ; Value, Description ; time, Specifies the number of seconds or milliseconds to wait before the transition...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found