SimpleTextFieldEvent

Sealed interface representing events triggered by the simple text field. This interface defines basic events that can occur during text input, providing real-time feedback about the input state.

The events include value changes and focus changes, providing a generic text input experience for any use case.

Example:

// Handle simple text field events
when (event) {
is SimpleTextFieldEvent.OnValueChanged -> {
// Handle value change
println("New value: ${event.value}")
}
is SimpleTextFieldEvent.OnFocusChanged -> {
if (event.isFocused) {
// Show hint or perform action on focus
}
}
}

See also

Inheritors

Types

Link copied to clipboard
data class OnFocusChanged(val isFocused: Boolean) : SimpleTextFieldEvent

Event triggered when the focus state of the text field changes. This event helps manage the visual state of the input field and can be used to show/hide additional UI elements based on focus.

Link copied to clipboard
data class OnValueChanged(val value: String) : SimpleTextFieldEvent

Event triggered when the text field value changes. This event is fired whenever the user types or deletes characters, providing the current input value.