-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Description
Problem
textarea s are allowed to have children (see MDN example). They are not rendered by Yew.
Steps To Reproduce
html! { <textarea>{"This is the default value"}</textarea> }See playground
Expected behavior
The text area should have default value
Screenshots
If applicable, add screenshots to help explain your problem.

Environment:
- Yew version: 0.20
- Rust version: irrelevant
(also i forgot when playground was deployed) - Target, if relevant: [e.g.
wasm32-unknown-emscripten]wasm32-unknown-unknown - Build tool, if relevant: [e.g.
wasm-pack,trunk]trunk - OS, if relevant: [e.g. MacOS]
Linux - Browser and version, if relevant: [e.g. Chrome v83]
Questionnaire
- 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
Fix
VTagInner::TextArea case should be handled here:
yew/packages/yew/src/virtual_dom/vtag.rs
Lines 289 to 300 in 40514a9
| pub fn children(&self) -> &VList { | |
| match &self.inner { | |
| VTagInner::Other { children, .. } => children, | |
| _ => { | |
| // This is mutable because the VList is not Sync | |
| static mut EMPTY: VList = VList::new(); | |
| // SAFETY: The EMPTY value is always read-only | |
| unsafe { &EMPTY } | |
| } | |
| } | |
| } |
The fix should really be implemented after/alongside #3289 to avoid merge conflicts
Reactions are currently unavailable