Fix issue with firefox autocomplete on LDAP login screen

In firefox if the keydown event overrides the default behaviour,
when the enter key is pressed, the autocomplete will not work.
This commit changes the event listener to use keyup instead of
keydown to allow for firefox autocomplete to work correctly.

Bug: Issue 6083
Change-Id: I6a91631166c0d21b92079af36f976b010c0244fd
This commit is contained in:
Reyad Attiyat 2017-04-26 19:05:13 -05:00 committed by David Pursehouse
parent b21f59ccef
commit 8c798de3d8

@ -65,13 +65,16 @@
var login_form = document.getElementById('login_form');
var f_user = document.getElementById('f_user');
var f_pass = document.getElementById('f_pass');
f_user.onkeydown = function(e) {
// Keyup event must be used to avoid issue with Firefox autocomplete
// Issue #6083
f_user.onkeyup = function(e) {
if (e.keyCode == 13) {
f_pass.focus();
return false;
}
}
f_pass.onkeydown = function(e) {
f_pass.onkeyup = function(e) {
if (e.keyCode == 13) {
login_form.submit();
return false;