diff options
3 files changed, 24 insertions, 0 deletions
diff --git a/client/src/main/java/com/vaadin/client/ui/FocusUtil.java b/client/src/main/java/com/vaadin/client/ui/FocusUtil.java index 6fbbc5d9df..0f517d89ed 100644 --- a/client/src/main/java/com/vaadin/client/ui/FocusUtil.java +++ b/client/src/main/java/com/vaadin/client/ui/FocusUtil.java @@ -96,12 +96,27 @@ public class FocusUtil { return focusable.getElement().getTabIndex(); } + /** + * Finds all the focusable children of given parent element. + * + * @param parent + * the parent element + * @return array of focusable children + * @since 8.1.7 + */ public static native Element[] getFocusableChildren(Element parent) /*-{ var focusableChildren = parent.querySelectorAll('[type][tabindex]:not([tabindex="-1"]), [role=button][tabindex]:not([tabindex="-1"])'); return focusableChildren; }-*/; + /** + * Moves the focus to the first focusable child of given parent element. + * + * @param parent + * the parent element + * @since 8.1.7 + */ public static void focusOnFirstFocusableElement(Element parent) { Element[] focusableChildren = getFocusableChildren(parent); if (focusableChildren.length > 0) { @@ -109,6 +124,13 @@ public class FocusUtil { } } + /** + * Moves the focus to the last focusable child of given parent element. + * + * @param parent + * the parent element + * @since 8.1.7 + */ public static void focusOnLastFocusableElement(Element parent) { Element[] focusableChildren = getFocusableChildren(parent); if (focusableChildren.length > 0) { diff --git a/client/src/main/java/com/vaadin/client/ui/VAccordion.java b/client/src/main/java/com/vaadin/client/ui/VAccordion.java index c103f9e726..f004b6d5d5 100644 --- a/client/src/main/java/com/vaadin/client/ui/VAccordion.java +++ b/client/src/main/java/com/vaadin/client/ui/VAccordion.java @@ -117,6 +117,7 @@ public class VAccordion extends VTabsheetBase { * * @param tabIndex * tabulator index for the open stack item + * @since 8.1.7 */ public void setTabIndex(int tabIndex) { tabulatorIndex = tabIndex; diff --git a/client/src/main/java/com/vaadin/client/ui/VTabsheet.java b/client/src/main/java/com/vaadin/client/ui/VTabsheet.java index c9c721bbe9..75ea3a4ce1 100644 --- a/client/src/main/java/com/vaadin/client/ui/VTabsheet.java +++ b/client/src/main/java/com/vaadin/client/ui/VTabsheet.java @@ -791,6 +791,7 @@ public class VTabsheet extends VTabsheetBase * * @param tabIndex * tabulator index for the active tab of the tab sheet + * @since 8.1.7 */ public void setTabIndex(int tabIndex) { tabulatorIndex = tabIndex; |