Enum Class FocusOption.PreventScroll

java.lang.Object
java.lang.Enum<FocusOption.PreventScroll>
com.vaadin.flow.component.FocusOption.PreventScroll
All Implemented Interfaces:
FocusOption, Serializable, Comparable<FocusOption.PreventScroll>, Constable
Enclosing interface:
FocusOption

public static enum FocusOption.PreventScroll extends Enum<FocusOption.PreventScroll> implements FocusOption
Scroll prevention option for focus operations.

Controls whether the browser should scroll the document to bring the newly-focused element into view.

  • Enum Constant Details

    • DEFAULT

      public static final FocusOption.PreventScroll DEFAULT
      Browser decides (default behavior is to scroll the element into view).

      When this option is used, the preventScroll property is not included in the options passed to the browser, allowing the browser to use its default behavior (which is to scroll).

    • ENABLED

      public static final FocusOption.PreventScroll ENABLED
      Prevent scrolling when focusing the element.

      Use this when you want to focus an element without changing the current scroll position.

    • DISABLED

      public static final FocusOption.PreventScroll DISABLED
      Allow scrolling when focusing the element (browser default).

      This explicitly enables the default browser behavior of scrolling the element into view when focused.

  • Method Details

    • values

      public static FocusOption.PreventScroll[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static FocusOption.PreventScroll valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null