Interface HasAutofocus

All Superinterfaces:
com.vaadin.flow.component.HasElement, Serializable
All Known Implementing Classes:
EntityPicker, JmixMultiValuePicker, JmixValuePicker, MenuFilterField, MultiValuePicker, SearchField, ValuePicker, ValuePickerBase

public interface HasAutofocus extends com.vaadin.flow.component.HasElement
Interface to be implemented by UI components that can automatically receive focus when the page is loaded.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The 'autofocus' property name.
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Returns whether this component should have input focus when the page loads.
    default void
    setAutofocus(boolean autofocus)
    Sets whether the component should automatically receive focus when the page loads.

    Methods inherited from interface com.vaadin.flow.component.HasElement

    getElement
  • Field Details

  • Method Details

    • isAutofocus

      default boolean isAutofocus()
      Returns whether this component should have input focus when the page loads.
      Returns:
      the autofocus property value
    • setAutofocus

      default void setAutofocus(boolean autofocus)
      Sets whether the component should automatically receive focus when the page loads. Defaults to false.
      Parameters:
      autofocus - true component should automatically receive focus