[
https://issues.apache.org/jira/browse/WICKET-7133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17900672#comment-17900672
]
ASF GitHub Bot commented on WICKET-7133:
----------------------------------------
strido commented on code in PR #1041:
URL: https://github.com/apache/wicket/pull/1041#discussion_r1855406505
##########
wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AutoCompleteSettings.java:
##########
@@ -379,4 +381,55 @@ public AutoCompleteSettings setMinInputLength(int
minInputLength)
this.minInputLength = minInputLength;
return this;
}
+
+ /**
+ * Indicates how the Tab key should be handled when having an item in
the autocomplete list
+ * selected, {@link TabBehavior#SELECT_FOCUS_NEXT_ELEMENT} is the
default behavior.
+ *
+ * @return the behavior that should be used when the Tab key is pressed
+ */
+ public TabBehavior getTabBehavior()
+ {
+ return tabBehavior;
+ }
+
+ /**
+ * Set how the Tab key should be handled when having an item in the
autocomplete list selected.
+ *
+ * @param tabSelectBehavior the behavior that should be used when the
Tab key is pressed,
+ * {@link TabBehavior#SELECT_FOCUS_NEXT_ELEMENT} is the default behavior
+ * @return this {@link AutoCompleteSettings}
+ */
+ public AutoCompleteSettings setTabBehavior(TabBehavior
tabSelectBehavior)
+ {
+ this.tabBehavior = tabSelectBehavior;
+ return this;
+ }
+
+ /**
+ * A behavior that can be used to control how the Tab key should be
handled when having an item
+ * in the autocomplete list is marked.
+ */
+ public enum TabBehavior {
Review Comment:
That seems like a better name!
I have renamed it and pushed the changes.
> Ability move focus back to the autocomplete field when selecting an item
> using the Tab key
> ------------------------------------------------------------------------------------------
>
> Key: WICKET-7133
> URL: https://issues.apache.org/jira/browse/WICKET-7133
> Project: Wicket
> Issue Type: Improvement
> Components: wicket-extensions
> Reporter: Erik Strid
> Priority: Major
> Attachments: myproject-tab-focus.zip
>
>
> We need the ability to prevent the autocomplete from moving the focus to the
> next component when the user press "Tab". The marked item should be selected
> but the focus should go back to the autocomplete input field.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)