From 392335899ad6b2466cf58ff92bea4d3a36419d94 Mon Sep 17 00:00:00 2001 From: Aman Harwara Date: Mon, 16 Jan 2023 23:20:59 +0530 Subject: [PATCH] fix: Fixed issue where opening a Super note would change its modified date (skip e2e) --- .../SuperEditor/Plugins/SearchPlugin/SearchPlugin.tsx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/web/src/javascripts/Components/NoteView/SuperEditor/Plugins/SearchPlugin/SearchPlugin.tsx b/packages/web/src/javascripts/Components/NoteView/SuperEditor/Plugins/SearchPlugin/SearchPlugin.tsx index 9f1e5c358..dd1ef7996 100644 --- a/packages/web/src/javascripts/Components/NoteView/SuperEditor/Plugins/SearchPlugin/SearchPlugin.tsx +++ b/packages/web/src/javascripts/Components/NoteView/SuperEditor/Plugins/SearchPlugin/SearchPlugin.tsx @@ -27,12 +27,6 @@ export const SearchPlugin = () => { const isCaseSensitiveRef = useStateRef(isCaseSensitive) const resultsRef = useStateRef(results) - useEffect(() => { - if (!isSearchActive) { - editor.focus() - } - }, [editor, isSearchActive]) - useEffect(() => { const isFocusInEditor = () => { if (!document.activeElement || !document.activeElement.closest('.blocks-editor')) { @@ -51,6 +45,7 @@ export const SearchPlugin = () => { event.preventDefault() event.stopPropagation() dispatch({ type: 'toggle-search' }) + editor.focus() }, }, {