mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 23:29:02 +02:00
fix(react/dialogs): prompt not setting default value properly
This commit is contained in:
parent
1f8aa90482
commit
54d613e00e
@ -33,12 +33,13 @@ function PromptDialogComponent() {
|
|||||||
const labelRef = useRef<HTMLLabelElement>(null);
|
const labelRef = useRef<HTMLLabelElement>(null);
|
||||||
const answerRef = useRef<HTMLInputElement>(null);
|
const answerRef = useRef<HTMLInputElement>(null);
|
||||||
const [ opts, setOpts ] = useState<PromptDialogOptions>();
|
const [ opts, setOpts ] = useState<PromptDialogOptions>();
|
||||||
const [ value, setValue ] = useState("");
|
const [ value, setValue ] = useState("");
|
||||||
const [ shown, setShown ] = useState(false);
|
const [ shown, setShown ] = useState(false);
|
||||||
|
|
||||||
useTriliumEvent("showPromptDialog", (opts) => {
|
useTriliumEvent("showPromptDialog", (opts) => {
|
||||||
setOpts(opts);
|
setOpts(opts);
|
||||||
setShown(true);
|
setShown(true);
|
||||||
|
setValue(opts.defaultValue ?? "");
|
||||||
})
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user