Commit 17c1314 1 parent 753add4 commit 17c1314 Copy full SHA for 17c1314
File tree 1 file changed +15
-4
lines changed
1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -120,17 +120,27 @@ const styles = StyleSheet.create({
120
120
121
121
type InputTextHelperRow = Pick <
122
122
InputTextProps ,
123
- "value" | "counterLimit" | "bottomMessage" | "bottomMessageColor"
123
+ | "value"
124
+ | "counterLimit"
125
+ | "bottomMessage"
126
+ | "bottomMessageColor"
127
+ | "inputType"
124
128
> ;
125
129
126
130
const HelperRow = ( {
127
131
value,
128
132
counterLimit,
129
133
bottomMessage,
130
- bottomMessageColor
134
+ bottomMessageColor,
135
+ inputType
131
136
} : InputTextHelperRow ) => {
132
137
const theme = useIOTheme ( ) ;
133
- const valueCount = useMemo ( ( ) => value . length , [ value ] ) ;
138
+
139
+ const valueCount = useMemo (
140
+ ( ) =>
141
+ inputType !== "default" ? value . replace ( / \s / g, "" ) . length : value . length ,
142
+ [ inputType , value ]
143
+ ) ;
134
144
135
145
const bottomMessageColorDefault : IOColors = theme [ "textBody-tertiary" ] ;
136
146
const bottomMessageColorValue =
@@ -518,10 +528,11 @@ export const TextInputBase = ({
518
528
519
529
{ ( bottomMessage || counterLimit ) && (
520
530
< HelperRow
521
- value = { value }
531
+ value = { inputValue }
522
532
bottomMessage = { bottomMessage }
523
533
bottomMessageColor = { bottomMessageColor }
524
534
counterLimit = { counterLimit }
535
+ inputType = { inputType }
525
536
/>
526
537
) }
527
538
</ >
You can’t perform that action at this time.
0 commit comments