mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
add onSelect callback
This commit is contained in:
@ -56,6 +56,8 @@ export class AutoComplete {
|
|||||||
/**@type {function}*/ updateDetailsPositionDebounced;
|
/**@type {function}*/ updateDetailsPositionDebounced;
|
||||||
/**@type {function}*/ updateFloatingPositionDebounced;
|
/**@type {function}*/ updateFloatingPositionDebounced;
|
||||||
|
|
||||||
|
/**@type {(item:AutoCompleteOption)=>any}*/ onSelect;
|
||||||
|
|
||||||
get matchType() {
|
get matchType() {
|
||||||
return power_user.stscript.matching ?? 'fuzzy';
|
return power_user.stscript.matching ?? 'fuzzy';
|
||||||
}
|
}
|
||||||
@ -669,6 +671,7 @@ export class AutoComplete {
|
|||||||
}
|
}
|
||||||
this.wasForced = false;
|
this.wasForced = false;
|
||||||
this.textarea.dispatchEvent(new Event('input', { bubbles:true }));
|
this.textarea.dispatchEvent(new Event('input', { bubbles:true }));
|
||||||
|
this.onSelect?.(this.selectedItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user