Skip to content

Fixed position element under animated.div causes position to be relative animated.div instead of window. #1481

Answered by branlok
branlok asked this question in Support
Discussion options

You must be logged in to vote

Ok i think I've whip up a quick solution for myself. added a state change onRest to convert end style transform: none. Although I thought it would rerun the animation again from scale(0.95) -> to transform: "none" - which I don't see here.

  const styles = useSpring({
    config: config.gentle,
    from: { transform: "scale(0.95)", opacity: 0 },
    to: {
      opacity: appear ? 1 : 0,
      transform: endTransform ? "none" : "scale(1)",
    },
    onRest: {
      transform: () => setEndTransform(true)
    }
    
  });

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@joshuaellis
Comment options

@branlok
Comment options

@joshuaellis
Comment options

@branlok
Comment options

Answer selected by branlok
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants