mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Typeahead workaround for having to press enter twice
Currently, one has to press enter twice in order to submit the package search form with typeahead completion. Add a workaround to fix this. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
0d68494de7
commit
72e4d54178
1 changed files with 9 additions and 0 deletions
|
@ -124,6 +124,15 @@ $(document).ready(function() {
|
|||
return item;
|
||||
}
|
||||
}).attr('autocomplete', 'off');
|
||||
|
||||
$('#pkgsearch-field').keydown(function(e) {
|
||||
if (e.keyCode == 13) {
|
||||
var selectedItem = $('ul.pkgsearch-typeahead li.active');
|
||||
if (selectedItem.length == 0) {
|
||||
$('#pkgsearch-form').submit();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
|
|
Loading…
Add table
Reference in a new issue