New Compose Multiplatform components arrived on Composables UICheck it out →

Component in Compose Foundation

DisableSelection

Common

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

Last updated:

Installation

dependencies {
   implementation("androidx.compose.foundation:foundation:1.7.0-beta04")
}

Overloads

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

Code Example

DisableSelectionSample

@Composable
@Sampled
fun DisableSelectionSample() {
    SelectionContainer {
        Column {
            Text("Text 1")

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

            Text("Text 3")
        }
    }
}