[autocomplete] allow right-arrow for completion

This commit is contained in:
Shish 2023-12-29 10:32:35 +00:00
parent 09051249a7
commit 8eb13f59e6

View file

@ -200,8 +200,8 @@ document.addEventListener('DOMContentLoaded', () => {
event.preventDefault();
highlightCompletion(element, element.selected_completion+1);
}
// if enter is pressed, add the selected completion
if(event.code === "Enter" && element.selected_completion !== -1) {
// if enter or right are pressed, add the selected completion
if((event.code === "Enter" || event.code == "ArrowRight") && element.selected_completion !== -1) {
event.preventDefault();
setCompletion(element, Object.keys(element.completions)[element.selected_completion]);
}