Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-otpcode-input

Package Overview
Dependencies
Maintainers
2
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-otpcode-input - npm Package Compare versions

Comparing version 0.1.57 to 0.1.59

7

index.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc