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.2.2 to 0.2.3

1

index.d.ts

@@ -10,2 +10,3 @@ /// <reference types="react" />

autoFocus?: boolean;
disabled: boolean;
}

@@ -12,0 +13,0 @@

15

index.js

@@ -69,3 +69,3 @@ "use strict";

suppressContentEditableWarning: true,
type: "number"
type: "tel"
})(_templateObject3());

@@ -81,3 +81,4 @@

onComplete = _ref.onComplete,
otp = _ref.otp;
otp = _ref.otp,
disabled = _ref.disabled;
var otpValue = otp.padEnd(numberOfInputs);

@@ -129,4 +130,8 @@ var inputs = Array(numberOfInputs).fill(0);

var box = document.getElementById("contentEditableBox");
box.addEventListener("keydown", handleKeyDown);
box.addEventListener("textInput", handleTextInput);
if (!disabled) {
box.addEventListener("keydown", handleKeyDown);
box.addEventListener("textInput", handleTextInput);
}
return function () {

@@ -136,3 +141,3 @@ box.removeEventListener("keydown", handleKeyDown);

};
}, [handleTextInput]);
}, [handleTextInput, disabled]);
return _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement(ContentEditableBox, {

@@ -139,0 +144,0 @@ id: "contentEditableBox",

@@ -26,3 +26,3 @@ import React, { useState, useEffect, useRef } from "react";

suppressContentEditableWarning: true,
type: "number"
type: "tel"
})`

@@ -48,3 +48,3 @@ position: fixed;

const OtpInput = ({ numberOfInputs, onChange, onComplete, otp }) => {
const OtpInput = ({ numberOfInputs, onChange, onComplete, otp, disabled }) => {
const otpValue = otp.padEnd(numberOfInputs);

@@ -94,4 +94,6 @@

const box = document.getElementById("contentEditableBox");
box.addEventListener("keydown", handleKeyDown);
box.addEventListener("textInput", handleTextInput);
if (!disabled) {
box.addEventListener("keydown", handleKeyDown);
box.addEventListener("textInput", handleTextInput);
}

@@ -102,3 +104,3 @@ return () => {

};
}, [handleTextInput]);
}, [handleTextInput, disabled]);

@@ -105,0 +107,0 @@ return (

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