So I need to allow only numbers to by typed in the field.
I configured TextField
with:
keyboardOptions = KeyboardOptions.Default.copy(
keyboardType = KeyboardType.Number
)
But still it allows me to type decimal separators (comma and dot)
So I don't see any difference between KeyboardType.Number
and KeyboardType.Decimal
, they work exactly the same...
Number
@Stable
public final val Number: KeyboardType
A keyboard type used to request an IME that is capable of inputting digits. IME may provide inputs other than digits but it is not guaranteed.
Decimal
@Stable
public final val Decimal: KeyboardType
A keyboard type used to request an IME that is capable of inputting decimals. IME should explicitly provide a decimal separator as input, which is not assured by KeyboardType.Number.
Why does it happen?