mirror of
https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git
synced 2026-01-26 19:19:57 +00:00
Fix for 1-letter completion
Completion would sometimes not show if the prompt was only one letter long and identical to the previous completion
This commit is contained in:
@@ -576,6 +576,8 @@ async function autocomplete(textArea, prompt, fixedTag = null) {
|
||||
// Guard for empty prompt
|
||||
if (prompt.length === 0) {
|
||||
hideResults(textArea);
|
||||
previousTags = [];
|
||||
tagword = "";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -590,6 +592,14 @@ async function autocomplete(textArea, prompt, fixedTag = null) {
|
||||
.concat(weightedTags);
|
||||
}
|
||||
|
||||
// Guard for no tags
|
||||
if (!tags || tags.length === 0) {
|
||||
previousTags = [];
|
||||
tagword = "";
|
||||
hideResults(textArea);
|
||||
return;
|
||||
}
|
||||
|
||||
let tagCountChange = tags.length - previousTags.length;
|
||||
let diff = difference(tags, previousTags);
|
||||
previousTags = tags;
|
||||
|
||||
Reference in New Issue
Block a user