I want to show a numeric keyboard by default but let the user change it to text.
var text by rememberSaveable { mutableStateOf("") }
TextField(
value = text,
onValueChange = { text = it },
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number)
)
I read a lot of old questions and answers but none of them were helpful, including:
How do I default to numeric keyboard on EditText without forcing numeric input?
EditText with number keypad by default, but allowing alphabetic characters