Fix Input component doesn't work if autoComplete=false (#1939)

The Input component doesn't work if its autoComplete prop is set to false, as described here: https://groups.google.com/g/zotero-dev/c/vKdxvZJL8UQ
This commit is contained in:
Diego de la Hera 2021-01-20 22:58:09 -03:00 committed by GitHub
parent cd63f96eee
commit 05e56acf77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -68,8 +68,8 @@ class Input extends React.PureComponent {
} }
} }
handleChange({ target }, options) { handleChange({ target }, { newValue } = {}) {
var newValue = options.newValue || target.value; newValue = newValue || target.value;
this.setState({ this.setState({
value: newValue, value: newValue,
}); });
@ -281,4 +281,4 @@ class Input extends React.PureComponent {
export default React.forwardRef((props, ref) => <Input export default React.forwardRef((props, ref) => <Input
innerRef={ref} {...props} innerRef={ref} {...props}
/>); />);