Skip to content

Commit

Permalink
small isolation and addition that solves one edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
yaakymiv committed Jun 9, 2024
1 parent b2e76ca commit d55bb92
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<FormItem label="Авторство">
<div className={isTextContentEmpty || isTitleEmpty ? "disabled" : ""}>
<Editor
qRef={editorRef}
value={(text === undefined || text === '') ? 'Текст підготовлений спільно з' : text}
onChange={(editor) => {
setInputInfo({ ...inputInfo, additionalText: editor });
onChange('additionalText', editor);
}}
onChange={handleEditorChange}
maxChars={maxLength}
readOnly={isTitleEmpty || isTextContentEmpty}
/>
Expand Down

0 comments on commit d55bb92

Please sign in to comment.