mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/44734 Fixes https://github.com/facebook/react-native/issues/44671 This integrates functionality for clipping content to padding box into `ReactViewBackgroundManager`, to be shared between several ViewManagers. In practice, this means: 1. `overflow: hidden` now works on `Text` and `TextInput` 2. ScrollView children are now clipped to the interior of borders, included curved ones via borderRadius This will be made more generic, then start being used in ReactViewGroup, and eventually ReactImage. That abstraction will then hide away extra background management we will use for shadows. Different places in code currently do clipping in any of `draw()`, `onDraw()`, or `dispatchDraw()`. The distinction between these, is that `draw()` allows code to run before drawing background even, `onDraw()` is invoked before drawing foreground, and `dispatchDraw()` is before drawing children. We don't want to clip out borders/shadows, but do want to clip foreground content like text, so I used `onDraw()` here. Changelog: [Android][Fixed] - Better overflow support for ScrollView, Text, TextInput Reviewed By: rozele Differential Revision: D57953429 fbshipit-source-id: ca3b788deb4b32706df7db958877d18f525c039c