DioxusLabs / DioxusLabs/dioxus
can't clear textarea
- Dominant language
- Rust
- Stars
- 39.1k
- Forks
- 1.9k
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 4
Description
**Problem**
using the `value` attribute for an `input` allows for clearing the content of the `input` from within a callback. `textarea` should be able to do this too.
**Steps To Reproduce**
Steps to reproduce the behavior:
```
fn App(cx: Scope) -> Element {
let text = use_state(&cx, String::new);
cx.render(rsx! {
textarea {
value: "{text}",
oninput: move |evt| text.set(evt.value.clone()),
onkeypress: move |evt| {
if evt.key_code == KeyCode::Enter {
text.set(String::from(""));
}
},
},
})
}
```
- input some text
- press enter
- the text does not disappear
**Expected behavior**
- the textarea should be cleared
**Questionnaire**
- [ x ] I'm interested in fixing this myself but don't know where to start
- [ ] I would like to fix and I have a solution
- [ ] I don't have time to fix this right now, but maybe later
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.