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/dialogs): prompt not setting default value properly
Elian Doran54d613e00ec2
diff --git a/apps/client/src/widgets/dialogs/prompt.tsx b/apps/client/src/widgets/dialogs/prompt.tsxindex 90aec49344..60ec94b889 100644--- a/apps/client/src/widgets/dialogs/prompt.tsx+++ b/apps/client/src/widgets/dialogs/prompt.tsx@@ -33,12 +33,13 @@ function PromptDialogComponent() {const labelRef = useRef<HTMLLabelElement>(null);const answerRef = useRef<HTMLInputElement>(null);const [ opts, setOpts ] = useState<PromptDialogOptions>();- const [ value, setValue ] = useState("");+ const [ value, setValue ] = useState("");const [ shown, setShown ] = useState(false);useTriliumEvent("showPromptDialog", (opts) => {setOpts(opts);setShown(true);+ setValue(opts.defaultValue ?? "");})return (