diff --git a/vaadin-ordered-layout-flow-parent/vaadin-ordered-layout-flow/src/main/java/com/vaadin/flow/component/orderedlayout/Scroller.java b/vaadin-ordered-layout-flow-parent/vaadin-ordered-layout-flow/src/main/java/com/vaadin/flow/component/orderedlayout/Scroller.java index 17437454f57..83f3fa7ce34 100644 --- a/vaadin-ordered-layout-flow-parent/vaadin-ordered-layout-flow/src/main/java/com/vaadin/flow/component/orderedlayout/Scroller.java +++ b/vaadin-ordered-layout-flow-parent/vaadin-ordered-layout-flow/src/main/java/com/vaadin/flow/component/orderedlayout/Scroller.java @@ -16,6 +16,7 @@ package com.vaadin.flow.component.orderedlayout; import com.vaadin.flow.component.Component; +import com.vaadin.flow.component.Focusable; import com.vaadin.flow.component.HasSize; import com.vaadin.flow.component.HasStyle; import com.vaadin.flow.component.Tag; @@ -39,8 +40,8 @@ @JsModule("@vaadin/polymer-legacy-adapter/style-modules.js") @NpmPackage(value = "@vaadin/scroller", version = "24.3.0-alpha11") @JsModule("@vaadin/scroller/src/vaadin-scroller.js") -public class Scroller extends Component - implements HasSize, HasStyle, HasThemeVariant { +public class Scroller extends Component implements Focusable, HasSize, + HasStyle, HasThemeVariant { private static final String SCROLL_DIRECTION_PROPERTY = "scrollDirection"; diff --git a/vaadin-ordered-layout-flow-parent/vaadin-ordered-layout-flow/src/test/java/com/vaadin/flow/component/orderedlayout/tests/ScrollerTest.java b/vaadin-ordered-layout-flow-parent/vaadin-ordered-layout-flow/src/test/java/com/vaadin/flow/component/orderedlayout/tests/ScrollerTest.java index ae4305de48e..fb78e510e55 100644 --- a/vaadin-ordered-layout-flow-parent/vaadin-ordered-layout-flow/src/test/java/com/vaadin/flow/component/orderedlayout/tests/ScrollerTest.java +++ b/vaadin-ordered-layout-flow-parent/vaadin-ordered-layout-flow/src/test/java/com/vaadin/flow/component/orderedlayout/tests/ScrollerTest.java @@ -19,9 +19,12 @@ import org.junit.Before; import org.junit.Test; +import com.vaadin.flow.component.Focusable; import com.vaadin.flow.component.html.Div; +import com.vaadin.flow.component.html.Input; import com.vaadin.flow.component.orderedlayout.Scroller; import com.vaadin.flow.component.orderedlayout.Scroller.ScrollDirection; +import com.vaadin.flow.component.orderedlayout.VerticalLayout; public class ScrollerTest { @@ -84,4 +87,20 @@ public void setNullScrollDirection_NullPointerExceptionIsThrown() { scroller.setScrollDirection(null); } + @Test + public void implementsFocusable() { + Assert.assertTrue("Scroller should be focusable", + Focusable.class.isAssignableFrom(scroller.getClass())); + } + + @Test + public void setEnabled_disableChildren() { + Input input = new Input(); + + scroller.setContent(new VerticalLayout(input)); + Assert.assertTrue(input.isEnabled()); + + scroller.setEnabled(false); + Assert.assertFalse(input.isEnabled()); + } }