# DisableSelection

Common/AllAndroid/JVM

## Functions summary

|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/selection/DisableSelection.composable#DisableSelection(kotlin.Function0)(content: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)` Disables text selection for its direct or indirect children. | Cmn |

## Functions

### DisableSelection

Cmn Artifact: [androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation) [View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/text/selection/SelectionContainer.kt+function:DisableSelection) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.0.0)

```
@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.

```kotlin
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.text.selection.DisableSelection
import androidx.compose.foundation.text.selection.SelectionContainer
import androidx.compose.material3.Text

SelectionContainer {
    Column {
        Text("Text 1")

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

        Text("Text 3")
    }
}
```