Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: zIndex crash without rounding (Fixes #748) #758

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

TheGuyWithoutH
Copy link

Error zIndex rounding made app crash

Description

As reported in #748, there was an issue on Android when using the stack layout. Once the user tried to drag the carousel, the app crashed. This is due to a problem in the zIndex calculation of the stack layout, that was not rounded in the end.

Review

  • I self-reviewed this PR
  • Test it on iOS

Testing

  • I added/updated tests
  • I manually tested

This is my first PR in a project like this, if I can improve anything please tell me 😄 !

Copy link

changeset-bot bot commented Jan 8, 2025

⚠️ No Changeset found

Latest commit: d1c8a91

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jan 8, 2025
Copy link

vercel bot commented Jan 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-reanimated-carousel ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 8, 2025 3:54pm

@ibrust
Copy link

ibrust commented Jan 10, 2025

FYI the same problem is happening with the zindex in parallax.ts. Can you fix it there as well? It's the same basic issue.
This line is all you need there:
// const zIndex = interpolate(value, [-1, 0, 1], [0, size, 0], Extrapolate.CLAMP, );
const zIndex = Math.round(interpolate(value, [-1, 0, 1], [0, size, 0]));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants