Skip to content

Commit 1dfb395

Browse files
authored
Support secureTextEntry in PinInput (#845)
1 parent 3b39627 commit 1dfb395

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/core/src/components/PinInput/PinInput.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ const PinInput = React.forwardRef<NativeTextInput, PinInputProps>(
5353
focusedBackgroundColor,
5454
focusedBorderWidth,
5555
focusedTextColor,
56+
secureTextEntry,
5657
style,
5758
...rest
5859
},
@@ -88,6 +89,9 @@ const PinInput = React.forwardRef<NativeTextInput, PinInputProps>(
8889
index: number,
8990
isFocused: boolean
9091
) => {
92+
if (secureTextEntry && cellValue) {
93+
cellValue = "•";
94+
}
9195
const cell = renderItem?.({ cellValue, index, isFocused }) || (
9296
<View
9397
testID="default-code-input-cell"
@@ -147,6 +151,7 @@ const PinInput = React.forwardRef<NativeTextInput, PinInputProps>(
147151
{renderCell(cellValue, index, isFocused)}
148152
</React.Fragment>
149153
)}
154+
secureTextEntry={secureTextEntry}
150155
{...rest}
151156
/>
152157
);

0 commit comments

Comments
 (0)