fix(react/dialogs): prompt not setting default value properly

This commit is contained in:
Elian Doran 2025-08-15 12:15:29 +03:00
parent 1f8aa90482
commit 54d613e00e
No known key found for this signature in database

View File

@ -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 (