Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(react): note title not selecting text
Elian Doran06cea99b401a
diff --git a/apps/client/src/widgets/note_title.tsx b/apps/client/src/widgets/note_title.tsxindex 5b27f0ab0c..e2f30bcfc5 100644--- a/apps/client/src/widgets/note_title.tsx+++ b/apps/client/src/widgets/note_title.tsx@@ -53,9 +53,12 @@ export default function NoteTitleWidget() {// Manage focus.const textBoxRef = useRef<HTMLInputElement>(null);const isNewNote = useRef<boolean>();- useTriliumEvents([ "focusOnTitle", "focusAndSelectTitle" ], (e) => {+ useTriliumEvents([ "focusOnTitle", "focusAndSelectTitle" ], (e, eventName) => {if (noteContext?.isActive() && textBoxRef.current) {textBoxRef.current.focus();+ if (eventName === "focusAndSelectTitle") {+ textBoxRef.current.select();+ }isNewNote.current = ("isNewNote" in e ? e.isNewNote : false);}});