React Native TextInput Vertical Padding Not Working
On iOS (not sure about Android – I experienced this in the iOS Simulator), I tried to set paddingVertical
on a <TextInput>
component with multiline
set to true
. However, padding was only applied to the bottom with no change to the top.
Solution: Use paddingTop
and paddingBottom
individually instead.
paddingHorizontal
seems to work as expected. ⭐️
A GitHub issue from 2022 seems to indicate this has been fixed. I'm using React Native 0.73.6
and Expo 50, so it's possible I have an out of date version somewhere. Or there is still something nuanced about this bug that hasn't been resolved yet.
Either way, the above change gives me the result I want without any ugly work-arounds. Onward!