From 0d6f54319ba7c015b48a811c19d2df2a3a09c05a Mon Sep 17 00:00:00 2001 From: AimerFan <1261105760@qq.com> Date: Thu, 2 Apr 2020 16:04:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DTextArea=E5=9C=A8Chrom?= =?UTF-8?q?e=E4=B8=8B=E8=BE=BE=E5=88=B0=E6=9C=80=E5=A4=A7=E9=AB=98?= =?UTF-8?q?=E5=BA=A6=E5=90=8E=E5=8F=B3=E4=BE=A7=E6=BB=9A=E5=8A=A8=E6=9D=A1?= =?UTF-8?q?=E9=97=AA=E7=83=81=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/input/ResizableTextArea.jsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/components/input/ResizableTextArea.jsx b/components/input/ResizableTextArea.jsx index 33714e3e71..83645d5881 100644 --- a/components/input/ResizableTextArea.jsx +++ b/components/input/ResizableTextArea.jsx @@ -51,13 +51,15 @@ const ResizableTextArea = { } const { minRows, maxRows } = autoSize; const textareaStyles = calculateNodeHeight(this.$refs.textArea, false, minRows, maxRows); - this.setState({ textareaStyles, resizing: true }, () => { - raf.cancel(this.resizeFrameId); - this.resizeFrameId = raf(() => { - this.setState({ resizing: false }); - this.fixFirefoxAutoScroll(); + setTimeout(() => { + this.setState({ textareaStyles, resizing: true }, () => { + raf.cancel(this.resizeFrameId); + this.resizeFrameId = raf(() => { + this.setState({ resizing: false }); + this.fixFirefoxAutoScroll(); + }); }); - }); + }, 0); }, // https://github.com/ant-design/ant-design/issues/21870 fixFirefoxAutoScroll() {