Question/feature : control of textAlignVertical for TextInput (multiline)
See original GitHub issueHi, I’m currently working with react-native-paper for both classical TextInput and multiline TextInput. Currently i have a style problem :
The distance between the label and the first line of TextInput value is different for multiline and !multiline TextInput. This is due to the property textAlignVertical which is set as “top” for !multiline fields and “center” for multiline. It is partially related to https://github.com/callstack/react-native-paper/pull/1020
Here is the code responsible of this behaviour : https://github.com/callstack/react-native-paper/blob/master/src/components/TextInput/TextInputFlat.tsx Line 267
textAlignVertical: multiline ? 'top' : 'center',
(and of course same for TextInputOutlined https://github.com/callstack/react-native-paper/blob/master/src/components/TextInput/TextInputOutlined.tsx
Is there a way to customize this style ? It seems there is not a lot of style going that far from style props to TextInput, they are intercepted by the line76 in TextInputFlat
const {
fontSize: fontSizeStyle,
fontWeight,
height,
paddingHorizontal,
...viewStyle
} = (StyleSheet.flatten(style) || {}) as TextStyle;
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:13 (1 by maintainers)
Top GitHub Comments
a fix by using native text input in the render prop https://github.com/callstack/react-native-paper/issues/1810#issuecomment-616817037
Same problem here for me, I’ve already passed 1/2 day on it, with no way to make something clean. It would be great to have more control on style with optional style props.