Skip to content

Commit 7378689

Browse files
committed
onChangeText implemented
1 parent db5c4ea commit 7378689

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

src/components/CardNumber.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const CardNumber: React.FC<FramesCardFieldProps> = (props) => {
3131
style={[styles.cardNumber, props.style]}
3232
onChangeText={(val: string) => {
3333
dispatch({ type: CARD_CHANGE, payload: val });
34+
props.onChangeText && props.onChangeText(val);
3435
if (
3536
val.replace(/[^0-9]/g, "").length >= 8 &&
3637
val.replace(/[^0-9]/g, "").substring(0, 8) !==

src/components/Cvv.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ const Cvv: React.SFC<FramesFieldProps> = (props) => {
3030
style={[styles.cvv, props.style]}
3131
value={state.cvv}
3232
maxLength={state.cvvLength}
33-
onChangeText={(val: string) =>
34-
dispatch({ type: CVV_CHANGE, payload: val })
35-
}
33+
onChangeText={(val: string) => {
34+
dispatch({ type: CVV_CHANGE, payload: val });
35+
props.onChangeText && props.onChangeText(val);
36+
}}
3637
/>
3738
);
3839
}}

src/components/ExpiryDate.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ const ExpiryDate: React.SFC<FramesFieldProps> = (props) => {
2929
{...props}
3030
style={[styles.expiryDate, props.style]}
3131
value={state.expiryDate}
32-
onChangeText={(val: string) =>
33-
dispatch({ type: DATE_CHANGE, payload: val })
34-
}
32+
onChangeText={(val: string) => {
33+
dispatch({ type: DATE_CHANGE, payload: val });
34+
props.onChangeText && props.onChangeText(val);
35+
}}
3536
/>
3637
);
3738
}}

0 commit comments

Comments
 (0)