From 7dc73895189d7f539a1c833625675ef538da7dde Mon Sep 17 00:00:00 2001 From: Sara Meneghetti Date: Fri, 15 Apr 2022 12:49:46 +0200 Subject: [PATCH] Add support for maskDelay set as 0 --- src/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 0a00f22..6df550f 100644 --- a/src/index.js +++ b/src/index.js @@ -75,7 +75,9 @@ class SmoothPinCodeInput extends Component { // handle password mask const maskDelay = password && - code.length > this.props.value.length; // only when input new char + code.length > this.props.value.length && // only when input new char + this.props.maskDelay > 0; // only if maskDelay is not 0 + this.setState({ maskDelay }); if (maskDelay) { // mask password after delay