Skip to content
This repository was archived by the owner on Aug 23, 2022. It is now read-only.

Commit ca5dda4

Browse files
Move value attr fallback to sensible location
1 parent f10a833 commit ca5dda4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/components/control-component-factory.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,10 @@ function createControlClass(s) {
664664
controlProps.children
665665
);
666666
}
667+
// Set a default value to prevent it being treated as uncontrolled input
668+
if (!controlProps.value && !mappedProps.value) {
669+
mappedProps.value = '';
670+
}
667671
return createElement(
668672
ComponentWrapper,
669673
{

src/components/control-strip-defaults-component.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ class ComponentWrapper extends Component {
1717
if (getRef) {
1818
otherProps.ref = getRef;
1919
}
20-
if (!otherProps.value) {
21-
otherProps.value = '';
22-
}
2320
const WrappedComponent = component;
2421
return <WrappedComponent {...otherProps} />;
2522
}

0 commit comments

Comments
 (0)