Repository navigation
Conversation
|
@Trancever @unikvozm @jbinda @matkoson @OlimpiaZurek Please check. Thanks. |
| visible?: Animated.Value; | ||
| textStyle?: StyleProp<TextStyle>; | ||
| side: AdornmentSide; | ||
| paddingHorizontal?: string | number | undefined; |
There was a problem hiding this comment.
Can we type it as paddingHorizontal?: number;?
There was a problem hiding this comment.
I'm not sure but I get Type 'string | number | undefined' is not assignable to type 'number'. error if I use paddingHorizontal?: number;. I am also new to typescript, any pointers will be appreciated.
Also according to the docs, paddingHorizontal has a type of number, string.
There was a problem hiding this comment.
Ok, I see. Then it should be paddingHorizontal?: number | string. We don't have to add undefined, because we already have a question mark after the prop name.
| .string(); | ||
|
|
||
| const offset = | ||
| paddingHorizontal !== undefined && typeof paddingHorizontal === 'number' |
There was a problem hiding this comment.
If we change the type we won't need this check typeof paddingHorizontal === 'number'
| adornmentConfig: AdornmentConfig[]; | ||
| leftAffixWidth: number; | ||
| rightAffixWidth: number; | ||
| paddingHorizontal?: string | number | undefined; |
| textStyle?: StyleProp<TextStyle>; | ||
| visible?: Animated.Value; | ||
| isTextInputFocused: boolean; | ||
| paddingHorizontal?: string | number | undefined; |
|
@Trancever Updated to |
|
Merged in 4b1c150 |
|
Does TextInput.Icon support? |
Summary
Fixes: #2303
paddingHorizontalis disregarded when usingleftprop onTextInput.Test plan
Snack: https://snack.expo.io/@dcangulo/textinput
Sample Code in screenshot:
Before this PR:

After this PR:
