Package com.vaadin.flow.component
Interface Focusable.FocusJs
- All Superinterfaces:
Serializable
The client-side operations behind
Focusable, as a JavaScript
definition for Element.executeJs(Class).
Focus and blur are marked as server-initiated for the client, so that the
resulting event reports isFromClient() == false. A driver of the
client side that implements this interface instead of running the scripts
is responsible for the same.
-
Method Summary
-
Method Details
-
focus
@JsExpression("setTimeout(() => {\n try {\n this._nextFocusIsFromClient = false;\n this.focus($0);\n } finally {\n this._nextFocusIsFromClient = true;\n }\n}, 0)\n") void focus(@Nullable tools.jackson.databind.node.ObjectNode options) Focuses the element.- Parameters:
options- the options of the browser'sfocusfunction, ornullfor its defaults, which is what the browser makes of an empty set of options
-
blur
@JsExpression("setTimeout(() => {\n try {\n this._nextBlurIsFromClient = false;\n this.blur();\n } finally {\n this._nextBlurIsFromClient = true;\n }\n}, 0)\n") void blur()Removes focus from the element.
-