1
0
Fork 0
mirror of https://github.com/TheLartians/ModernCppStarter.git synced 2025-09-03 07:30:53 +02:00
This commit is contained in:
TheLartians 2020-11-09 11:23:02 +00:00
parent 4974ed8548
commit 5bed31b5dd
17 changed files with 87 additions and 53 deletions

View file

@ -666,8 +666,10 @@ if(typeof document !== 'undefined') {
} else if(event.key == 'Tab' && !event.shiftKey && !event.ctrlKey && !event.altKey && !event.metaKey) {
/* But only if the input has selection at the end */
let input = document.getElementById('search-input');
if(input.selectionEnd == input.value.length && input.selectionStart != input.selectionEnd)
if(input.selectionEnd == input.value.length && input.selectionStart != input.selectionEnd) {
input.setSelectionRange(input.value.length, input.value.length);
return false; /* so input won't lose focus */
}
/* Select next item */
} else if(event.key == 'ArrowDown') {