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

react-otpcode-input

Package Overview
Dependencies
Maintainers
1
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.33 to 0.1.34

11

index.js

@@ -97,4 +97,2 @@ "use strict";

console.log(value);
var handleKeyDown = function handleKeyDown(e) {

@@ -112,4 +110,3 @@ if (e.keyCode === 8) {

if (key === "backSpaceKey" && active !== 0) {
setActive(active - 1); // setOtpValues(otpValues.slice(0, otpValues.length - 1));
setActive(active - 1);
setOtpValues(otpValues.slice(0, otpValues.length - 1));

@@ -120,4 +117,3 @@ onChange(otpValues);

if (!isNumber(key)) return;else {
setActive(active + 1); // setOtpValues(otpValues.concat(key));
setActive(active + 1);
setOtpValues(otpValues + key);

@@ -135,2 +131,5 @@ onChange(otpValues);

(0, _react.useEffect)(function () {
console.log(value); // eslint-disable-next-line react-hooks/exhaustive-deps
}, [value]);
(0, _react.useEffect)(function () {
var box = document.getElementById("contentEditableBox");

@@ -137,0 +136,0 @@ box.addEventListener("keydown", handleKeyDown);

@@ -53,4 +53,2 @@ import React, { useState, useEffect } from "react";

console.log(value);
const handleKeyDown = e => {

@@ -70,3 +68,2 @@ if (e.keyCode === 8) {

setActive(active - 1);
// setOtpValues(otpValues.slice(0, otpValues.length - 1));
setOtpValues(otpValues.slice(0, otpValues.length - 1));

@@ -79,3 +76,2 @@ onChange(otpValues);

setActive(active + 1);
// setOtpValues(otpValues.concat(key));
setOtpValues(otpValues + key);

@@ -94,2 +90,8 @@ onChange(otpValues);

useEffect(() => {
console.log(value);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [value]);
useEffect(() => {
const box = document.getElementById("contentEditableBox");

@@ -96,0 +98,0 @@ box.addEventListener("keydown", handleKeyDown);

{
"name": "react-otpcode-input",
"version": "0.1.33",
"version": "0.1.34",
"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