A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
web: fix editor title temporary flicker on tab switch (#9548)
01zulfid48643cbb98c
diff --git a/apps/web/src/components/editor/index.tsx b/apps/web/src/components/editor/index.tsxindex 9ef5e4dae..b1f34dd9f 100644--- a/apps/web/src/components/editor/index.tsx+++ b/apps/web/src/components/editor/index.tsx@@ -711,12 +711,12 @@ function EditorChrome(props: PropsWithChildren<EditorProps>) {}});- const editorTitle = document.querySelector("#editor-title");+ const editorTitle = document.querySelector(`#editor-title-${id}`);if (editorTitle instanceof HTMLTextAreaElement) {resizeTextarea(editorTitle);}}- const observer = new ResizeObserver(debounce(onResize, 500));+ const observer = new ResizeObserver(onResize);observer.observe(editorScrollRef.current);return () => {observer.disconnect();diff --git a/apps/web/src/components/editor/title-box.tsx b/apps/web/src/components/editor/title-box.tsxindex df7d35951..d9aa85156 100644--- a/apps/web/src/components/editor/title-box.tsx+++ b/apps/web/src/components/editor/title-box.tsx@@ -100,7 +100,7 @@ function TitleBox(props: TitleBoxProps) {<Textarearef={inputRef}variant="clean"- id="editor-title"+ id={`editor-title-${id}`}data-test-id="editor-title"className="editorTitle"placeholder={strings.noteTitle()}@@ -157,6 +157,8 @@ export default React.memo(TitleBox, (prevProps, nextProps) => {});export function resizeTextarea(input: HTMLTextAreaElement) {+ if (input.scrollHeight === 0) return;+input.style.height = "auto";requestAnimationFrame(() => {input.style.height = input.scrollHeight + "px";