Skip to content

Commit df3811a

Browse files
author
Edward Xiao
committed
no message
1 parent 03f7662 commit df3811a

9 files changed

+11
-26
lines changed

lib/components/Textarea.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ var component = function component(_ref) {
514514
setInternalValue(String(value));
515515
}, [value]);
516516
useEffect(function () {
517-
if (prevInternalValue && prevInternalValue !== internalValue) {
517+
if (typeof prevInternalValue !== 'undefined' && prevInternalValue !== internalValue) {
518518
if (option.customFunc) {
519519
check();
520520
}

lib/components/Textbox.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -661,20 +661,12 @@ var component = function component(_ref) {
661661
setInternalValue(String(value));
662662
}, [value]);
663663
useEffect(function () {
664-
if (prevInternalValue && prevInternalValue !== internalValue) {
664+
if (typeof prevInternalValue !== 'undefined' && prevInternalValue !== internalValue) {
665665
if (option.customFunc) {
666666
check();
667667
}
668668
}
669669
}, [internalValue]);
670-
useEffect(function () {
671-
/* istanbul ignore if because it won't happen */
672-
if ($el === null) {
673-
return;
674-
}
675-
676-
$el.current.removeAttribute('value');
677-
});
678670
useEffect(function () {
679671
if (asyncObj) {
680672
if (asyncObj.message) {

lib/react-inputs-validation.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/react-inputs-validation.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/react-inputs-validation.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/react-inputs-validation.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-inputs-validation",
3-
"version": "3.4.3",
3+
"version": "3.4.5",
44
"description": "React form input validation components",
55
"main": "index.js",
66
"repository": {

src/js/Inputs/Textarea.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ const component: React.FC<Props> = ({
316316
);
317317
useEffect(
318318
() => {
319-
if (prevInternalValue && prevInternalValue !== internalValue) {
319+
if (typeof prevInternalValue !== 'undefined' && prevInternalValue !== internalValue) {
320320
if (option.customFunc) {
321321
check();
322322
}

src/js/Inputs/Textbox.tsx

+1-8
Original file line numberDiff line numberDiff line change
@@ -396,21 +396,14 @@ const component: React.FC<Props> = ({
396396
);
397397
useEffect(
398398
() => {
399-
if (prevInternalValue && prevInternalValue !== internalValue) {
399+
if (typeof prevInternalValue !== 'undefined' && prevInternalValue !== internalValue) {
400400
if (option.customFunc) {
401401
check();
402402
}
403403
}
404404
},
405405
[internalValue],
406406
);
407-
useEffect(() => {
408-
/* istanbul ignore if because it won't happen */
409-
if ($el === null) {
410-
return;
411-
}
412-
$el.current.removeAttribute('value');
413-
});
414407
useEffect(
415408
() => {
416409
if (asyncObj) {

0 commit comments

Comments
 (0)