software-mansion / react-native-screens

Native navigation primitives for your React Native app.
https://docs.swmansion.com/react-native-screens/
MIT License
3.11k stars 521 forks source link

fix(Android): prevent sheet footer from flickering on sheet sliding #2505

Closed kkafar closed 1 week ago

kkafar commented 1 week ago

Description

Previous implementation of sheetTopWhileDragging relied on linear interpolation. Due to numeric errors in floating point division sometimes the footer was +- 1 pixel up/down from the accurate position, resulting in 1px flickering / "dancing".

This PR changes the way sheet top is computed to making use of the parent screen top property, whenever possible.

Changes

Test code and steps to reproduce

Added dedicated test TestFormSheet.

Checklist