Package com.vaadin.flow.component
Interface FocusOption
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
FocusOption.FocusVisible,FocusOption.PreventScroll
Marker interface for focus options.
Implementations of this interface can be passed to
Focusable.focus(FocusOption...).
See HTMLElement.focus() for more information.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumFocus visibility option for focus operations.static enumScroll prevention option for focus operations. -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic tools.jackson.databind.node.ObjectNodebuildOptions(FocusOption... options) Builds an ObjectNode containing the focus options for use with the browser's focus() method.
-
Method Details
-
buildOptions
Builds an ObjectNode containing the focus options for use with the browser's focus() method.This method extracts FocusVisible and PreventScroll options from the varargs and builds a JSON object compatible with the browser's HTMLElement.focus() API. Returns null if all options are at their default values.
- Parameters:
options- zero or more focus options- Returns:
- an ObjectNode with the focus options, or null if all options are default
-