Skip to content

Commit d85f72a

Browse files
author
Erik Strid
committed
Renamed the TabBehavior to KeyTabBehavior
1 parent 323d64c commit d85f72a

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AbstractAutoCompleteBehavior.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ protected final String constructSettingsJS()
187187
{
188188
sb.append(",className: '").append(settings.getCssClassName()).append('\'');
189189
}
190-
sb.append(",tabBehavior: '").append(
191-
settings.getTabBehavior().getValue()).append('\'');
190+
sb.append(",keyTabBehavior: '").append(
191+
settings.getKeyTabBehavior().getValue()).append('\'');
192192
sb.append('}');
193193
return sb.toString();
194194
}

wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AutoCompleteSettings.java

+11-10
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public final class AutoCompleteSettings implements IClusterable
7474

7575
private int minInputLength = 1;
7676

77-
private TabBehavior tabBehavior = TabBehavior.SELECT_FOCUS_NEXT_ELEMENT;
77+
private KeyTabBehavior keyTabBehavior = KeyTabBehavior.SELECT_FOCUS_NEXT_ELEMENT;
7878

7979
/**
8080
* Indicates whether the first item in the list is automatically selected when the autocomplete
@@ -384,33 +384,34 @@ public AutoCompleteSettings setMinInputLength(int minInputLength)
384384

385385
/**
386386
* Indicates how the Tab key should be handled when having an item in the autocomplete list
387-
* selected, {@link TabBehavior#SELECT_FOCUS_NEXT_ELEMENT} is the default behavior.
387+
* selected, {@link KeyTabBehavior#SELECT_FOCUS_NEXT_ELEMENT} is the default behavior.
388388
*
389389
* @return the behavior that should be used when the Tab key is pressed
390390
*/
391-
public TabBehavior getTabBehavior()
391+
public KeyTabBehavior getKeyTabBehavior()
392392
{
393-
return tabBehavior;
393+
return keyTabBehavior;
394394
}
395395

396396
/**
397397
* Set how the Tab key should be handled when having an item in the autocomplete list selected.
398398
*
399-
* @param tabSelectBehavior the behavior that should be used when the Tab key is pressed,
400-
* {@link TabBehavior#SELECT_FOCUS_NEXT_ELEMENT} is the default behavior
399+
* @param keyTabBehavior the behavior that should be used when the Tab key is pressed,
400+
* {@link KeyTabBehavior#SELECT_FOCUS_NEXT_ELEMENT} is the default behavior
401401
* @return this {@link AutoCompleteSettings}
402402
*/
403-
public AutoCompleteSettings setTabBehavior(TabBehavior tabSelectBehavior)
403+
public AutoCompleteSettings setKeyTabBehavior(KeyTabBehavior keyTabBehavior)
404404
{
405-
this.tabBehavior = tabSelectBehavior;
405+
this.keyTabBehavior = keyTabBehavior;
406406
return this;
407407
}
408408

409409
/**
410410
* A behavior that can be used to control how the Tab key should be handled when having an item
411411
* in the autocomplete list is marked.
412412
*/
413-
public enum TabBehavior {
413+
public enum KeyTabBehavior
414+
{
414415
/**
415416
* Select the currently marked item and move the focus to the next focusable element.
416417
*/
@@ -422,7 +423,7 @@ public enum TabBehavior {
422423

423424
private final String value;
424425

425-
TabBehavior(String value)
426+
KeyTabBehavior(String value)
426427
{
427428
this.value = value;
428429
}

wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@
184184

185185
hideAutoComplete();
186186

187-
if (cfg.tabBehavior === 'selectFocusAutocompleteInput' && keyCode === KEY_TAB) {
187+
if (cfg.keyTabBehavior === 'selectFocusAutocompleteInput' && keyCode === KEY_TAB) {
188188
// prevent moving focus to the next component if an item in the dropdown is selected
189189
// using the Tab key
190190
jqEvent.preventDefault();

0 commit comments

Comments
 (0)