refactor: update magic input value
update magic input value by state Change-Id: I019c3470a06304ced4357b37535ee740c5af16a9
This commit is contained in:
parent
8732b9ef1f
commit
5b98220229
@ -441,8 +441,8 @@ class MagicInput extends PureComponent {
|
||||
};
|
||||
|
||||
clearInputValue = () => {
|
||||
this.inputRef.current.setState({
|
||||
value: '',
|
||||
this.setState({
|
||||
inputValue: '',
|
||||
});
|
||||
};
|
||||
|
||||
@ -547,7 +547,7 @@ class MagicInput extends PureComponent {
|
||||
|
||||
render() {
|
||||
const { placeholder } = this.props;
|
||||
const { isFocus } = this.state;
|
||||
const { isFocus, inputValue } = this.state;
|
||||
return (
|
||||
<div
|
||||
className={classnames(
|
||||
@ -575,6 +575,7 @@ class MagicInput extends PureComponent {
|
||||
onFocus={this.handleFocus}
|
||||
onPressEnter={this.handleEnter}
|
||||
onKeyUp={this.handleKeyUp}
|
||||
value={inputValue}
|
||||
/>
|
||||
{this.renderMenu()}
|
||||
</Col>
|
||||
|
Loading…
Reference in New Issue
Block a user