fix autocomplete select on blank / "no match"

This commit is contained in:
LenAnderson
2024-04-20 08:30:46 -04:00
parent c47a034b74
commit 94fa19bd2d
2 changed files with 2 additions and 1 deletions

View File

@ -2318,7 +2318,7 @@ export async function setSlashCommandAutoComplete(textarea, isFloating = false)
case 'Enter': case 'Enter':
case 'Tab': { case 'Tab': {
// pick the selected item to autocomplete // pick the selected item to autocomplete
if (evt.ctrlKey || evt.altKey || evt.shiftKey) return; if (evt.ctrlKey || evt.altKey || evt.shiftKey || selectedItem.type == OPTION_TYPE.BLANK) return;
evt.preventDefault(); evt.preventDefault();
evt.stopImmediatePropagation(); evt.stopImmediatePropagation();
select(); select();

View File

@ -8,6 +8,7 @@ export const OPTION_TYPE = {
'COMMAND': 1, 'COMMAND': 1,
'QUICK_REPLY': 2, 'QUICK_REPLY': 2,
'VARIABLE_NAME': 3, 'VARIABLE_NAME': 3,
'BLANK': 4,
}; };
export class SlashCommandFuzzyScore { export class SlashCommandFuzzyScore {