intelicoreact 0.1.68 → 0.1.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -123,7 +123,7 @@ function InputMask() {
|
|
|
123
123
|
isFocused = _useState6[0],
|
|
124
124
|
setFocused = _useState6[1];
|
|
125
125
|
|
|
126
|
-
var _useState7 = (0, _react.useState)(
|
|
126
|
+
var _useState7 = (0, _react.useState)(false),
|
|
127
127
|
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
128
128
|
isInitValue = _useState8[0],
|
|
129
129
|
setIsInitValue = _useState8[1]; // ERRORS MANAGEMENT FUNCTIONS | START //
|
|
@@ -654,6 +654,7 @@ function InputMask() {
|
|
|
654
654
|
|
|
655
655
|
key = e.key, keyCode = e.keyCode;
|
|
656
656
|
charObj = getCharByIndex(i); // Android Text Typing FIX
|
|
657
|
+
// eslint-disable-next-line eqeqeq
|
|
657
658
|
|
|
658
659
|
if (!(keyCode == _config.ANDROID_CHROME_TEXT_CODE)) {
|
|
659
660
|
_context2.next = 9;
|
|
@@ -1092,18 +1093,22 @@ function InputMask() {
|
|
|
1092
1093
|
setMaskRendered(true);
|
|
1093
1094
|
}, [maskPattern]);
|
|
1094
1095
|
(0, _react.useEffect)(function () {
|
|
1095
|
-
if (!isMaskRendered || isInitValue) return false;
|
|
1096
|
+
if (!isMaskRendered || isInitValue || value === getClearInnerValueAsString()) return false;
|
|
1096
1097
|
|
|
1097
|
-
if (value && value !== ''
|
|
1098
|
+
if (value && value !== '') {
|
|
1098
1099
|
var valueCharIndex = 0;
|
|
1099
1100
|
innerValue.map(function (_ref25, i) {
|
|
1101
|
+
var _maskPattern;
|
|
1102
|
+
|
|
1100
1103
|
var isSpecialSymbol = _ref25.isSpecialSymbol;
|
|
1101
1104
|
if (isSpecialSymbol) return false;
|
|
1102
1105
|
var char = value[valueCharIndex];
|
|
1106
|
+
var whileLimit = ((_maskPattern = maskPattern) === null || _maskPattern === void 0 ? void 0 : _maskPattern.length) || 0;
|
|
1103
1107
|
|
|
1104
|
-
while (isSpecialSymbolChar({
|
|
1108
|
+
while (whileLimit && isSpecialSymbolChar({
|
|
1105
1109
|
char: value[valueCharIndex]
|
|
1106
1110
|
})) {
|
|
1111
|
+
whileLimit--;
|
|
1107
1112
|
char = value[++valueCharIndex];
|
|
1108
1113
|
} //If Valid
|
|
1109
1114
|
|
|
@@ -1121,6 +1126,8 @@ function InputMask() {
|
|
|
1121
1126
|
++valueCharIndex;
|
|
1122
1127
|
});
|
|
1123
1128
|
}
|
|
1129
|
+
|
|
1130
|
+
setIsInitValue(true);
|
|
1124
1131
|
}, [isMaskRendered, value, isInitValue]); // Focus Observer
|
|
1125
1132
|
|
|
1126
1133
|
(0, _react.useEffect)(function () {
|