refactor: update magic input value

update magic input value by state

Change-Id: I019c3470a06304ced4357b37535ee740c5af16a9
This commit is contained in:
Jingwei.Zhang 2023-07-13 14:40:15 +08:00
parent 8732b9ef1f
commit 5b98220229

View File

@ -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>