Package com.vaadin.flow.component.shared
Interface HasTextSelection.TextSelectionJs
- All Superinterfaces:
Serializable
- Enclosing interface:
HasTextSelection
For internal use only. May be renamed or removed in a future release.
-
Method Summary
Modifier and TypeMethodDescriptionvoidsetSelectionRange(int selectionStart, int selectionEnd) Sets the text selection of the input element and focuses the field.
-
Method Details
-
setSelectionRange
@JsExpression("setTimeout(() => {\n const i = this.inputElement;\n if (!i) return;\n i.setSelectionRange($0, $1);\n const autoselect = this.autoselect;\n try {\n this.autoselect = false;\n this._nextFocusIsFromClient = false;\n this.focus();\n } finally {\n this.autoselect = autoselect;\n this._nextFocusIsFromClient = true;\n }\n}, 0)\n") void setSelectionRange(int selectionStart, int selectionEnd) Sets the text selection of the input element and focuses the field.- Parameters:
selectionStart- the index of the first selected character, inclusiveselectionEnd- the index after the last selected character, exclusive
-