Skip to content

Commit

Permalink
docs: add 'blurOnFilled' prop to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
anday013 committed May 28, 2024
1 parent 2a78023 commit 9c0e6bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,15 @@ The `react-native-otp-entry` component accepts the following props:
| ---------------------------- | ---------------------- | -------------------------------------------------------------------------------------------------------------- |
| `numberOfDigits` | number | The number of digits to be displayed in the OTP entry. |
| `textInputProps` | TextInputProps | Extra props passed to underlying hidden TextInput (see: https://reactnative.dev/docs/textinput) |
| `autoFocus` | boolean | Default: true. Set autofocus. |
| `autoFocus` | boolean | _Default: true_. Sets autofocus. |
| `focusColor` | ColorValue | The color of the input field border and stick when it is focused. |
| `onTextChange` | (text: string) => void | A callback function is invoked when the OTP text changes. It receives the updated text as an argument. |
| `onFilled` | (text: string) => void | A callback function is invoked when the OTP input is fully filled. It receives a full otp code as an argument. |
| `hideStick` | boolean | Hide cursor of the focused input. |
| `blurOnFilled` | boolean | _Default: false_. Blurs (unfocuses) the input when the OTP input is fully filled. |
| `hideStick` | boolean | _Default: false_. Hides cursor of the focused input. |
| `theme` | Theme | Custom styles for each element. |
| `focusStickBlinkingDuration` | number | The duration (in milliseconds) for the focus stick to blink. |
| `disabled` | boolean | Default: false. Disable the input |
| `disabled` | boolean | _Default: false_. Disables the input |

| Theme | Type | Description |
| ------------------------------- | --------- | ---------------------------------------------------------------------------------- |
Expand Down
2 changes: 1 addition & 1 deletion src/OtpInput/OtpInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const OtpInput = forwardRef<OtpInputRef, OtpInputProps>((props, ref) => {
const char = text[index];
const isFocusedInput = index === focusedInputIndex && !disabled && Boolean(isFocused);
const isFilledLastInput = text.length === numberOfDigits && index === text.length - 1;
const isFocusedContainer = isFocusedInput || (isFilledLastInput && Boolean(isFocused))
const isFocusedContainer = isFocusedInput || (isFilledLastInput && Boolean(isFocused));

return (
<Pressable
Expand Down

0 comments on commit 9c0e6bb

Please sign in to comment.