Elffuss BraidHub

kikocis/continue public

only focus main editor on mode toggle if another editor doesn't already have focus
Changeset5d05a85d8b4cb583dec13c9e47407b8bdab3d87c62bf9034d542bd6cd4290d51
AuthorDallin Romney <dallinromney@gmail.com> · 2025-07-01 12:20 -07:00
CommitterDallin Romney <dallinromney@gmail.com> · 2025-07-01 12:20 -07:00
Parents54bc82ab2ee9

Browse the files at this changeset

1 file changed

modified gui/src/components/ModeSelect/ModeSelect.tsx +4 −1
@@ -34,7 +34,10 @@
3434
3535 const cycleMode = useCallback(() => {
3636 dispatch(setMode(mode === "chat" ? "agent" : "chat"));
37- mainEditor?.commands.focus();
37+ // Only focus main editor if another one doesn't already have focus
38+ if (!document.activeElement?.classList?.contains("ProseMirror")) {
39+ mainEditor?.commands.focus();
40+ }
3841 }, [mode, mainEditor]);
3942
4043 const selectMode = useCallback(