# CommitTextCommand

Artifact: [androidx.compose.ui:ui-text](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/text/input/EditCommand.kt+class:androidx.compose.ui.text.input.CommitTextCommand) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Common/AllAndroid/JVM
- Cmn

  ```
  class CommitTextCommand : EditCommand
  ```

*** ** * ** ***

Commit final `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/CommitTextCommand#text()` to the text box and set the new cursor position.

See [`commitText`](https://developer.android.com/reference/android/view/inputmethod/InputConnection.html#commitText(java.lang.CharSequence,%20int)).

## Summary

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/CommitTextCommand#CommitTextCommand(androidx.compose.ui.text.AnnotatedString,kotlin.Int)( annotatedString: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString, newCursorPosition: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/CommitTextCommand#CommitTextCommand(kotlin.String,kotlin.Int)(text: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, newCursorPosition: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` | Cmn |

| ### Public functions |
|---|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/CommitTextCommand#applyTo(androidx.compose.ui.text.input.EditingBuffer)(buffer: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/EditingBuffer)` Apply the command on the editing buffer. | Cmn |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/CommitTextCommand#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/CommitTextCommand#hashCode()()` | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/CommitTextCommand#toString()()` | Cmn |

| ### Public properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/CommitTextCommand#annotatedString()` The text to commit. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/CommitTextCommand#newCursorPosition()` The cursor position after inserted text. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/CommitTextCommand#text()` | Cmn |

## Public constructors

### CommitTextCommand

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
CommitTextCommand(
    annotatedString: AnnotatedString,
    newCursorPosition: Int
)
```

| Parameters |
|---|---|
| `annotatedString: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | The text to commit. |
| `newCursorPosition: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The cursor position after inserted text. |

### CommitTextCommand

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
CommitTextCommand(text: String, newCursorPosition: Int)
```

## Public functions

### applyTo

Cmn

```
open fun applyTo(buffer: EditingBuffer): Unit
```

Apply the command on the editing buffer.

### equals

Cmn

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

Cmn

```
open fun hashCode(): Int
```

### toString

Cmn

```
open fun toString(): String
```

## Public properties

### annotatedString

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val annotatedString: AnnotatedString
```

The text to commit.

### newCursorPosition

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val newCursorPosition: Int
```

The cursor position after inserted text.

### text

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val text: String
```