react-otpcode-input
Advanced tools
Comparing version 0.1.57 to 0.1.59
@@ -120,2 +120,4 @@ "use strict"; | ||
(0, _react.useEffect)(function () { | ||
console.log(otpValues); | ||
if (otpValues.length === numberOfInputs) { | ||
@@ -126,4 +128,4 @@ onComplete(otpValues); | ||
(0, _react.useEffect)(function () { | ||
// reset | ||
contentEditableBoxRef.current.focus(); | ||
// sync value | ||
setOtpValues(defaultValue); // reset | ||
@@ -133,2 +135,3 @@ if (defaultValue === "") { | ||
setOtpValues(defaultValue); | ||
contentEditableBoxRef.current.focus(); | ||
} | ||
@@ -135,0 +138,0 @@ }, [defaultValue]); |
@@ -79,2 +79,4 @@ import React, { useState, useEffect, useRef } from "react"; | ||
useEffect(() => { | ||
console.log(otpValues); | ||
if (otpValues.length === numberOfInputs) { | ||
@@ -86,7 +88,10 @@ onComplete(otpValues); | ||
useEffect(() => { | ||
// sync value | ||
setOtpValues(defaultValue); | ||
// reset | ||
contentEditableBoxRef.current.focus(); | ||
if (defaultValue === "") { | ||
setActiveIndex(activeIndex); | ||
setOtpValues(defaultValue); | ||
contentEditableBoxRef.current.focus(); | ||
} | ||
@@ -93,0 +98,0 @@ }, [defaultValue]); |
{ | ||
"name": "react-otpcode-input", | ||
"version": "0.1.57", | ||
"version": "0.1.59", | ||
"description": "OTP Input Component", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12292
246