New Compose Multiplatform components arrived on Composables UICheck it out →

DisableSelection

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

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