mirror of https://github.com/vector-im/riot-web
Ensure we always set some value in Field
Always set some value on the Field's input so that it doesn't flip flop between controlled and uncontrolled.pull/21833/head
parent
ea050683bd
commit
5a648ecfe4
|
@ -88,8 +88,8 @@ export default class Field extends React.PureComponent {
|
|||
|
||||
inputProps.onChange = this.onChange;
|
||||
// make sure we use the current `value` for the field and not the original one
|
||||
if (this.value != undefined) {
|
||||
inputProps.value = this.value;
|
||||
if (inputProps.value === undefined) {
|
||||
inputProps.value = this.value || "";
|
||||
}
|
||||
|
||||
const fieldInput = React.createElement(inputElement, inputProps, children);
|
||||
|
|
Loading…
Reference in New Issue