diff --git a/src/index.tsx b/src/index.tsx index 3afd218..21fa653 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -70,7 +70,7 @@ const OTPInput = ({ const [activeInput, setActiveInput] = React.useState(0); const inputRefs = React.useRef>([]); - const getOTPValue = () => (value ? value.toString().split('') : []); + const getOTPValue = () => (value ? value.toString().split('') : Array(numInputs).fill(' ')); const isInputNum = inputType === 'number' || inputType === 'tel';