diff --git a/.github/assets/react-native-input-code-otp.gif b/.github/assets/react-native-input-code-otp.gif deleted file mode 100644 index f83abee..0000000 Binary files a/.github/assets/react-native-input-code-otp.gif and /dev/null differ diff --git a/.github/assets/react-native-input-code-otp.png b/.github/assets/react-native-input-code-otp.png new file mode 100644 index 0000000..ac66dc0 Binary files /dev/null and b/.github/assets/react-native-input-code-otp.png differ diff --git a/README.md b/README.md index 0c60901..f98b998 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,13 @@ react-native-input-code-otp is a high-performance and fully customizable OTP input component for React Native, inspired by @shadcn/ui. -![Presentation Video](./.github/assets/react-native-input-code-otp.gif) +![Presentation Image](./.github/assets/react-native-input-code-otp.png) + +## Demo + +Try it on Snack Expo: + +[![Snack Expo App](https://img.shields.io/badge/Snack-fff.svg?style=for-the-badge&logo=EXPO&labelColor=000&logoColor=FFF)](https://snack.expo.dev/@anday013/demo-react-native-otp-entry) ## Installation diff --git a/src/hooks/use-text-input-otp.tsx b/src/hooks/use-text-input-otp.tsx index 25e6efa..efbb85e 100644 --- a/src/hooks/use-text-input-otp.tsx +++ b/src/hooks/use-text-input-otp.tsx @@ -50,6 +50,8 @@ export function TextInputOTPProvider({ if (text.length === maxLength) { onFilled?.(text); + setCurrentIndex(text.length - 1); + return; } if (text.length < maxLength) {