armstrong-react
Advanced tools
Comparing version
/// <reference types="react" /> | ||
import * as React from "react"; | ||
import { IFormInputHTMLProps } from '../form'; | ||
import { IFormInputHTMLProps } from "../form"; | ||
export interface ICodeInputProps extends IFormInputHTMLProps<React.SelectHTMLAttributes<HTMLInputElement>> { | ||
@@ -5,0 +5,0 @@ lengthPerBox: number[]; |
@@ -21,6 +21,7 @@ "use strict"; | ||
var el; | ||
current.value = current.value.slice(0, this.props.lengthPerBox[this.state.focusIndex]); | ||
var currentVal = current.value.trim(); | ||
currentVal = currentVal.slice(0, this.props.lengthPerBox[this.state.focusIndex]); | ||
if (e.keyCode === 8) { | ||
movingBack = true; | ||
if (current.value.length === 0) { | ||
if (currentVal.length === 0) { | ||
el = current.previousSibling; | ||
@@ -35,3 +36,3 @@ } | ||
} | ||
if (current.value.length < this.props.lengthPerBox[this.state.focusIndex] && !movingBack) { | ||
if (currentVal.length < this.props.lengthPerBox[this.state.focusIndex] && !movingBack) { | ||
return; | ||
@@ -104,3 +105,3 @@ } | ||
var classes = index_1.ClassHelpers.classNames("armstrong-input", "code-input", this.props.className, { | ||
"show-validation": (validationMode !== "none" && validationMessage) | ||
"show-validation": validationMode !== "none" && validationMessage | ||
}); | ||
@@ -107,0 +108,0 @@ return (React.createElement("div", { className: classes }, |
{ | ||
"name": "armstrong-react", | ||
"version": "2.5.6", | ||
"version": "2.5.7", | ||
"description": "Rocketmakers Armstrong library of React components", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
757506
014928
-0.02%