Function

clearText

Deletes all the text in the state.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free

clearText

Common
fun TextFieldState.clearText()

Deletes all the text in the state.

To perform more complicated edits on the text, call TextFieldState.edit. This function is equivalent to calling:

edit { delete(0, length) placeCursorAtEnd()
}