Skip to content

Commit 20f5dcb

Browse files
author
Edward Xiao
committed
no message
1 parent 09070b1 commit 20f5dcb

File tree

9 files changed

+41
-7
lines changed

9 files changed

+41
-7
lines changed

lib/components/Textarea.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,13 @@ var component = function component(_ref) {
513513
useEffect(function () {
514514
setInternalValue(String(value));
515515
}, [value]);
516+
useEffect(function () {
517+
if (prevInternalValue && prevInternalValue !== internalValue) {
518+
if (option.customFunc) {
519+
check();
520+
}
521+
}
522+
}, [internalValue]);
516523
useEffect(function () {
517524
if (asyncObj) {
518525
if (asyncObj.message) {

lib/components/Textbox.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,13 @@ var component = function component(_ref) {
660660
useEffect(function () {
661661
setInternalValue(String(value));
662662
}, [value]);
663+
useEffect(function () {
664+
if (prevInternalValue && prevInternalValue !== internalValue) {
665+
if (option.customFunc) {
666+
check();
667+
}
668+
}
669+
}, [internalValue]);
663670
useEffect(function () {
664671
/* istanbul ignore if because it won't happen */
665672
if ($el === null) {

lib/react-inputs-validation.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/react-inputs-validation.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/react-inputs-validation.min.js

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-inputs-validation",
3-
"version": "3.4.0",
3+
"version": "3.4.2",
44
"description": "React form input validation components",
55
"main": "index.js",
66
"repository": {

src/js/Inputs/Textarea.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,16 @@ const component: React.FC<Props> = ({
314314
},
315315
[value],
316316
);
317+
useEffect(
318+
() => {
319+
if (prevInternalValue && prevInternalValue !== internalValue) {
320+
if (option.customFunc) {
321+
check();
322+
}
323+
}
324+
},
325+
[internalValue],
326+
);
317327
useEffect(
318328
() => {
319329
if (asyncObj) {

src/js/Inputs/Textbox.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,16 @@ const component: React.FC<Props> = ({
394394
},
395395
[value],
396396
);
397+
useEffect(
398+
() => {
399+
if (prevInternalValue && prevInternalValue !== internalValue) {
400+
if (option.customFunc) {
401+
check();
402+
}
403+
}
404+
},
405+
[internalValue],
406+
);
397407
useEffect(() => {
398408
/* istanbul ignore if because it won't happen */
399409
if ($el === null) {

0 commit comments

Comments
 (0)