paoloconte
03/17/2022, 12:12 PMvar text by remember { mutableStateOf("") }
Input(type = InputType.Text, attrs = {
defaultValue(text)
onChange { event ->
text = event.target.value
}
})
If I then set text = ""
the input field is not cleared, as defaultValue is not reapplied... so how can I clear it? is the only way using a reference to the HTMLInputElement?
Thankshfhbd
03/17/2022, 1:48 PMvalue(text)
paoloconte
03/17/2022, 1:51 PMhfhbd
03/17/2022, 2:08 PMvar text by remember { mutableStateOf("InitValue") }
Input(type = InputType.Text) {
value(text)
placeholder("Username")
onInput {
text = it.value
}
}
paoloconte
03/17/2022, 2:17 PMonChange
instead of onInput
, that's why... thanks @hfhbd