🌈 Create new beautiful Compose Gradients with our new wesite ->
Function

setSelection

Action to set text selection by character index range.

setSelection

Source set: Common
public fun SemanticsPropertyReceiver.setSelection(
    label: String? = null,
    action: ((startIndex: Int, endIndex: Int, relativeToOriginalText: Boolean) -> Boolean)?,
): Unit

Action to set text selection by character index range.

If this action is provided, the selection data must be provided using textSelectionRange.

Parameters

label Optional label for this action.
action Action to be performed when the SemanticsActions.SetSelection is called. The parameters to the action are: startIndex, endIndex, and whether the indices are relative to the original text or the transformed text (when a VisualTransformation is applied).