From 476ce8ba889cd9965fed4c75c094e62444cc43ff Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Thu, 27 Jan 2022 18:59:16 +0700 Subject: [PATCH] fixed textarea autosizing on commit --- src/components/input/Textarea/index.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/input/Textarea/index.tsx b/src/components/input/Textarea/index.tsx index 890e608c..2d35b4fc 100644 --- a/src/components/input/Textarea/index.tsx +++ b/src/components/input/Textarea/index.tsx @@ -11,7 +11,6 @@ import React, { import autosize from 'autosize'; import classNames from 'classnames'; - import { InputWrapper } from '~/components/input/InputWrapper'; import { useForwardRef } from '~/hooks/dom/useForwardRef'; @@ -58,14 +57,14 @@ const Textarea = forwardRef( useEffect(() => { if (!ref?.current) return; - autosize(ref?.current); + autosize(ref.current); return () => autosize.destroy(ref); }, [ref]); useEffect(() => { if (!ref?.current) return; - autosize.update(ref); + autosize.update(ref.current); }, [ref, value, forwardRef]); return (