Motion: [FEATURE] zIndex delay transition

Created on 2 Aug 2019  路  6Comments  路  Source: framer/motion

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

bug feature

All 6 comments

Odd - the delay in your example should work. I feel like this is a bug.

Edit: Nice drop down btw

Hi, I would like to point out that recently I did something similar with scaleX and scaleY, and could not make it work, I do not know if this information could help on fixing the issue

initial: {
    scale: 0,
},
final: ({ calculatedWidth }) => ({
    scaleX: window.innerWidth / calculatedWidth,
    scaleY: window.innerHeight,
    transition: {
        scaleX: {
            duration: 0.3,
        },
        scaleY: {
            delay: 0.3,
            duration: 0.3,
        },
    },
}),

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

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

@EricVanDerDijs It does seem that value-specific delays aren't working, I'll take a look

Thanks @InventingWithMonster

Value-specific delay fixed in 1.6.5

Was this page helpful?
0 / 5 - 0 ratings