diff --git a/CHANGELOG.md b/CHANGELOG.md index 309e97db..b6cd9715 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ and this project adheres to - 🦺(backend) add comma to sub regex #408 - 🐛(editor) collaborative user tag hidden when read only #385 - 🐛(frontend) users have view access when revoked #387 +- 🐛(frontend) fix placeholder editable when double clicks #454 ## [1.7.0] - 2024-10-24 diff --git a/src/frontend/apps/impress/src/features/docs/doc-header/components/DocTitle.tsx b/src/frontend/apps/impress/src/features/docs/doc-header/components/DocTitle.tsx index 0a8a7f90..6c6a9dcf 100644 --- a/src/frontend/apps/impress/src/features/docs/doc-header/components/DocTitle.tsx +++ b/src/frontend/apps/impress/src/features/docs/doc-header/components/DocTitle.tsx @@ -57,7 +57,7 @@ const DocTitleInput = ({ doc }: DocTitleProps) => { const { broadcast } = useBroadcastStore(); const { mutate: updateDoc } = useUpdateDoc({ - listInvalideQueries: [KEY_DOC, KEY_LIST_DOC], + listInvalideQueries: [KEY_LIST_DOC], onSuccess(data) { if (data.title !== untitledDocument) { toast(t('Document title updated successfully'), VariantType.SUCCESS); @@ -104,6 +104,10 @@ const DocTitleInput = ({ doc }: DocTitleProps) => { } }; + useEffect(() => { + setTitleDisplay(doc.title); + }, [doc.title]); + useEffect(() => { if ((!debounceRef.current && !isUntitled) || !headingText) { return; @@ -129,6 +133,7 @@ const DocTitleInput = ({ doc }: DocTitleProps) => { $radius="4px" $padding={{ horizontal: 'tiny', vertical: '4px' }} $margin="none" + $minWidth="200px" contentEditable={isFirefox() ? 'true' : 'plaintext-only'} onClick={handleOnClick} onBlurCapture={(e) =>