Skip to content

Commit f74ff30

Browse files
author
Edward Xiao
committed
- removeAttribute('value') in <Textbox/>
1 parent 2608cf2 commit f74ff30

File tree

7 files changed

+23
-5
lines changed

7 files changed

+23
-5
lines changed

lib/components/Textbox.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,14 @@ var component = function component(_ref) {
648648
useEffect(function () {
649649
setInternalValue(String(value));
650650
}, [value]);
651+
useEffect(function () {
652+
/* istanbul ignore if because it won't happen */
653+
if ($el === null) {
654+
return;
655+
}
656+
657+
$el.current.removeAttribute('value');
658+
}, [internalValue]);
651659
useEffect(function () {
652660
if (asyncObj) {
653661
if (asyncObj.message) {

lib/react-inputs-validation.js

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.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: 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.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.2.3",
3+
"version": "3.2.4",
44
"description": "React form input validation components",
55
"main": "index.js",
66
"repository": {

src/js/Inputs/Textbox.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,16 @@ const component: React.FC<Props> = ({
385385
},
386386
[value],
387387
);
388+
useEffect(
389+
() => {
390+
/* istanbul ignore if because it won't happen */
391+
if ($el === null) {
392+
return;
393+
}
394+
$el.current.removeAttribute('value');
395+
},
396+
[internalValue],
397+
);
388398
useEffect(
389399
() => {
390400
if (asyncObj) {

0 commit comments

Comments
 (0)