Package com.vaadin.flow.component
Class ScrollOptions
java.lang.Object
com.vaadin.flow.component.ScrollOptions
- All Implemented Interfaces:
Serializable
Options for scrollIntoView.
See https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Alignment for scrollIntoView.static enum
Scroll behavior for scrollIntoView. -
Constructor Summary
ConstructorDescriptionCreate an instance with the default options.ScrollOptions
(ScrollOptions.Behavior behavior) Create an instance with the given scroll behavior.ScrollOptions
(ScrollOptions.Behavior behavior, ScrollOptions.Alignment block, ScrollOptions.Alignment inline) Create an instance with the given scroll options. -
Method Summary
Modifier and TypeMethodDescriptionGets the scroll behavior.getBlock()
Gets the vertical alignment.Gets the horizontal alignment.void
setBehavior
(ScrollOptions.Behavior behavior) Sets the scroll behavior.void
setBlock
(ScrollOptions.Alignment block) Sets the vertical alignment.void
setInline
(ScrollOptions.Alignment inline) Sets the horizontal alignment.toJson()
Convert to json in a form compatible with element.scrollIntoView.
-
Constructor Details
-
ScrollOptions
public ScrollOptions()Create an instance with the default options. -
ScrollOptions
Create an instance with the given scroll behavior.- Parameters:
behavior
- the behavior
-
ScrollOptions
public ScrollOptions(ScrollOptions.Behavior behavior, ScrollOptions.Alignment block, ScrollOptions.Alignment inline) Create an instance with the given scroll options.- Parameters:
behavior
- the behaviorblock
- the vertical alignmentinline
- the horizontal alignment
-
-
Method Details
-
setBehavior
Sets the scroll behavior.- Parameters:
behavior
- the behavior
-
getBehavior
Gets the scroll behavior.- Returns:
- the behavior
-
setBlock
Sets the vertical alignment.- Parameters:
block
- the vertical alignment
-
getBlock
Gets the vertical alignment.- Returns:
- the vertical alignment
-
setInline
Sets the horizontal alignment.- Parameters:
inline
- the horizontal alignment
-
getInline
Gets the horizontal alignment.- Returns:
- the horizontal alignment
-
toJson
Convert to json in a form compatible with element.scrollIntoView.- Returns:
- a json object as a string
-