Merge "refactor: update magic input value"

This commit is contained in:
Zuul 2023-07-16 01:43:08 +00:00 committed by Gerrit Code Review
commit 6e6a6ea46d

View File

@ -441,8 +441,8 @@ class MagicInput extends PureComponent {
}; };
clearInputValue = () => { clearInputValue = () => {
this.inputRef.current.setState({ this.setState({
value: '', inputValue: '',
}); });
}; };
@ -547,7 +547,7 @@ class MagicInput extends PureComponent {
render() { render() {
const { placeholder } = this.props; const { placeholder } = this.props;
const { isFocus } = this.state; const { isFocus, inputValue } = this.state;
return ( return (
<div <div
className={classnames( className={classnames(
@ -575,6 +575,7 @@ class MagicInput extends PureComponent {
onFocus={this.handleFocus} onFocus={this.handleFocus}
onPressEnter={this.handleEnter} onPressEnter={this.handleEnter}
onKeyUp={this.handleKeyUp} onKeyUp={this.handleKeyUp}
value={inputValue}
/> />
{this.renderMenu()} {this.renderMenu()}
</Col> </Col>