Skip to content

Commit

Permalink
Fix jshint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Strid authored and bitstorm committed Dec 2, 2024
1 parent c05d4b8 commit d227133
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@
});

Wicket.Event.add(obj, 'keydown', function (jqEvent) {
switch(Wicket.Event.keyCode(jqEvent)){
var keyCode = Wicket.Event.keyCode(jqEvent);
switch (keyCode) {
case KEY_UP:
if (elementCount > 0) {
if (selected>-1) {
Expand Down Expand Up @@ -169,10 +170,6 @@
}
break;
case KEY_TAB:
if (cfg.focusInputOnTabSelection && selected > -1) {
// prevent moving focus to the next component if an item in the dropdown is selected
jqEvent.preventDefault();
}
case KEY_ENTER:
ignoreKeyEnter = false;

Expand All @@ -187,6 +184,12 @@

hideAutoComplete();

if (cfg.focusInputOnTabSelection && keyCode === KEY_TAB) {
// prevent moving focus to the next component if an item in the dropdown is selected
// using the Tab key
jqEvent.preventDefault();
}

ignoreKeyEnter = true;
} else if (Wicket.AutoCompleteSettings.enterHidesWithNoSelection) {
hideAutoComplete();
Expand Down

0 comments on commit d227133

Please sign in to comment.