{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

SelectionContainerKt

public final class SelectionContainerKt


Summary

Public methods

static final void

Disables text selection for its direct or indirect children.

static final void
@Composable
SelectionContainer(
    @NonNull Modifier modifier,
    @Composable @NonNull Function0<Unit> content
)

Enables text selection for its direct or indirect children.

Public methods

DisableSelection

@Composable
public static final void DisableSelection(@Composable @NonNull Function0<Unit> content)

Disables text selection for its direct or indirect children. To use this, simply add this to wrap one or more text composables.

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.text.selection.DisableSelection
import androidx.compose.foundation.text.selection.SelectionContainer
import androidx.compose.material.Text

SelectionContainer {
    Column {
        Text("Text 1")

        DisableSelection {
            Text("Text 2")
            Text("טקסט 3")
        }

        Text("Text 3")
    }
}

SelectionContainer

@Composable
public static final void SelectionContainer(
    @NonNull Modifier modifier,
    @Composable @NonNull Function0<Unit> content
)

Enables text selection for its direct or indirect children.

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.text.selection.SelectionContainer
import androidx.compose.material.Text

SelectionContainer {
    Column {
        Text("Text 1")
        Text("Text 2")
        Text("טקסט 3")
    }
}