Skip to content

Commit a38a3d5

Browse files
authored
NumberInput - support maxLength (#2998)
1 parent ce12f9c commit a38a3d5

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

demo/src/screens/componentScreens/NumberInputScreen.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ const NumberInputScreen = () => {
152152
label,
153153
labelStyle: styles.label,
154154
style: textStyle,
155+
maxLength: 6,
155156
validate,
156157
validationMessage,
157158
validationMessageStyle: Typography.text80M,

src/components/numberInput/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ function NumberInput(props: NumberInputProps, ref: any) {
197197
<MaskedInput
198198
testID={testID}
199199
ref={ref}
200+
maxLength={textFieldProps?.maxLength}
200201
renderMaskedText={renderNumberInput}
201202
keyboardType={'numeric'}
202203
initialValue={initialNumber ? `${initialNumber}` : undefined}

0 commit comments

Comments
 (0)