DisableSelection

Functions summary

Unit

Disables text selection for its direct or indirect children.

Cmn

Functions

DisableSelection

@Composable
fun DisableSelection(content: @Composable () -> Unit): Unit

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")
    }
}