From 5b98220229104728a775f64ce82e9da1745997f1 Mon Sep 17 00:00:00 2001 From: "Jingwei.Zhang" Date: Thu, 13 Jul 2023 14:40:15 +0800 Subject: [PATCH] refactor: update magic input value update magic input value by state Change-Id: I019c3470a06304ced4357b37535ee740c5af16a9 --- src/components/MagicInput/index.jsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/MagicInput/index.jsx b/src/components/MagicInput/index.jsx index 7e88042e..59eedd81 100644 --- a/src/components/MagicInput/index.jsx +++ b/src/components/MagicInput/index.jsx @@ -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 (
{this.renderMenu()}