fix(Android, FormSheet v5): Prevent translation to be overridden by doOnStart callback - #4581
fix(Android, FormSheet v5): Prevent translation to be overridden by doOnStart callback#4581t0maboro wants to merge 1 commit into
doOnStart callback#4581Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe form sheet animator removes the unused Changes
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to This narrowly removes a redundant callback that could restore the sheet’s off-screen translation when system animations are disabled. No actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. ✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
With system animations disabled, the FormSheet stayed off-screen. The root cause was the
doOnStartlistener attached to the enteringAnimatorSet. It relied on start listeners running before the child animators produce any value, which is not the case when the duration scale is 0.startAnimationpulses every child, but with a zero duration,ValueAnimatortreats the animator as already finished, so the children synchronously apply their end values. After that,notifyStartListenersruns ourdoOnStart, which moves the sheet back totranslationY = height.The listener is also redundant. The
keepOffscreenUntilEnterAnimationappliestranslationYin the first pre-draw of the sheet, i.e. beforeOnShowListenerstarts the animator.Closes: https://github.com/software-mansion/react-native-screens-labs/issues/1764
Changes
doOnStartlistener that re-applied the translationBefore & after - visual documentation
before.mov
after.mov
Test plan
Disable animations in device settings, launch any FormSheet v5 example.
Checklist