keyboard: Prevent input focus loss if no completion found

This prevents the command line input from losing focus when <kbd>Tab</kbd>
is hit, but there was no command completion found.
This commit is contained in:
Jonas Hermsmeier 2017-06-28 15:47:21 +02:00
parent 3cd2434882
commit e25e316bf4
No known key found for this signature in database
GPG Key ID: 1B870F801A0CEE9F

View File

@ -17,9 +17,9 @@ function Keyboard()
// Autocomplete with tab
if(event.keyCode === 9){
event.preventDefault();
var ac = ronin.terminal.find_autocomplete();
if(ac){
event.preventDefault();
ronin.terminal.input.value += ac;
}
}