mirror of
https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git
synced 2026-01-26 19:19:57 +00:00
Added left/right arrow capture
Also fixes unexpected insertion behavior when moving after the window opened
This commit is contained in:
@@ -250,7 +250,7 @@ function autocomplete(prompt) {
|
||||
}
|
||||
|
||||
function navigateInList(event) {
|
||||
validKeys = ["ArrowUp", "ArrowDown", "Enter", "Escape"];
|
||||
validKeys = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Enter", "Escape"];
|
||||
|
||||
if (!validKeys.includes(event.key)) return;
|
||||
if (!isVisible) return
|
||||
@@ -270,6 +270,12 @@ function navigateInList(event) {
|
||||
selectedTag = (selectedTag + 1) % resultCount;
|
||||
}
|
||||
break;
|
||||
case "ArrowLeft":
|
||||
selectedTag = 0;
|
||||
break;
|
||||
case "ArrowRight":
|
||||
selectedTag = resultCount - 1;
|
||||
break;
|
||||
case "Enter":
|
||||
if (selectedTag != null) {
|
||||
insertTextAtCursor(results[selectedTag][0], tagword);
|
||||
|
||||
Reference in New Issue
Block a user