Giter Club home page Giter Club logo

layout-animation-and-z-index-issue's Introduction

Reanimated Layout Animation and z-index issue on Android

This is a minimal repro demonstrating an issue with z-index behavior on Android after a Reanimated layout animation being triggered on the app.

Z-index positioning behaves as you would expect consistently until the first layout animation is triggered at any point on the app. From that point, if Views that rely on z-index to be positioned are unmounted and remounted, the behavior will not be realiable anymore.

What I learned on my tests is that you don't even need to be on the same screen where you triggered the layout animation. On your whole app you can't expect z-index to behave properly anymore if you're unmounting/remounting with conditional rendering.

Instructions

  1. Make sure you are running it on Android
  2. Toggle the blue View visibility on and off multiple times. It should work consistently and the blue View should be always on top of the red one when visible.
  3. Now press the "Trigger Layout Animation" button.
  4. Try step 2 again by toggling the visbility multiple times. After three or four toggles it's not reliable anymore.

Expo Snack

This minimal repro has no Expo and it's using the latest Reanimated.

But I also created an Expo snack for convenience: https://snack.expo.dev/@leonardorib/layout-animations-and-zindex-issue-on-android

The snack uses Reanimated 3.6.2, since it's the recommended version for Expo SDK 50.

layout-animation-and-z-index-issue's People

Contributors

leonardorib avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.