mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 15:19:01 +02:00
feat(react/bulk_actions): clear autocomplete selection
This commit is contained in:
parent
09b12052f0
commit
abfffcec07
@ -10,7 +10,7 @@ interface NoteAutocompleteProps {
|
||||
placeholder?: string;
|
||||
container?: RefObject<HTMLDivElement>;
|
||||
opts?: Omit<Options, "container">;
|
||||
onChange?: (suggestion: Suggestion) => void;
|
||||
onChange?: (suggestion: Suggestion | null) => void;
|
||||
onTextChange?: (text: string) => void;
|
||||
}
|
||||
|
||||
@ -35,7 +35,12 @@ export default function NoteAutocomplete({ inputRef: _ref, text, placeholder, on
|
||||
$autoComplete
|
||||
.on("autocomplete:noteselected", listener)
|
||||
.on("autocomplete:externallinkselected", listener)
|
||||
.on("autocomplete:commandselected", listener);
|
||||
.on("autocomplete:commandselected", listener)
|
||||
.on("autocomplete:closed", (e) => {
|
||||
if (!ref.current?.value) {
|
||||
listener(e, null);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (onTextChange) {
|
||||
$autoComplete.on("input", () => onTextChange($autoComplete[0].value));
|
||||
|
Loading…
x
Reference in New Issue
Block a user