From d55bb92025c90262ae2a5a011cca2eeaace80e42 Mon Sep 17 00:00:00 2001 From: yaakymiv Date: Sun, 9 Jun 2024 12:24:24 +0300 Subject: [PATCH] small isolation and addition that solves one edge case --- .../AdditionalTextBlockAdminForm.component.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/features/AdminPage/NewStreetcode/TextBlock/TextForm/AdditionTextBlock/AdditionalTextBlockAdminForm.component.tsx b/src/features/AdminPage/NewStreetcode/TextBlock/TextForm/AdditionTextBlock/AdditionalTextBlockAdminForm.component.tsx index b6346b743..52c715345 100644 --- a/src/features/AdminPage/NewStreetcode/TextBlock/TextForm/AdditionTextBlock/AdditionalTextBlockAdminForm.component.tsx +++ b/src/features/AdminPage/NewStreetcode/TextBlock/TextForm/AdditionTextBlock/AdditionalTextBlockAdminForm.component.tsx @@ -34,16 +34,19 @@ const AdditionalTextBlockAdminForm = ({ setIsTitleEmpty(!inputInfo?.title || inputInfo.title === ""); }, [inputInfo?.title]); + + const handleEditorChange = (editor: string) => { + setInputInfo((prev) => ({ ...prev, additionalText: editor })); + onChange('additionalText', editor); + }; + return (
{ - setInputInfo({ ...inputInfo, additionalText: editor }); - onChange('additionalText', editor); - }} + onChange={handleEditorChange} maxChars={maxLength} readOnly={isTitleEmpty || isTextContentEmpty} />