Open bigmistqke opened 1 month ago
Why not just do <textarea>static</textarea>
?
@danieltroger that is a good temporary solution, but preferably textarea.value
would work with static values too, since it is a bit counterintuitive that it does not work + in case of props you can't know if it will be static or not and then (props) => <textarea value={props.value}>{props.value}</textarea>
becomes a bit much.
this is one of those cases where attribute/property distinction causing different behaviors. textarea
does not have value
attribute unlike other form elements but does have value
property and that's exactly what the playground uncovers. the solution/workaround is to either force prop:value
or put it in children as daniel suggested.
@mdynnl o that's interesting! i was not expecting that to be the cause. attribute/property is so messy...
Describe the bug
When setting the value of a textarea with a static string, it does not set the property, while if you set the value while calling a function it does get set.
Your Example Website or App
https://playground.solidjs.com/anonymous/54d80eb1-0ae9-4016-8300-e8f058f975d9
Steps to Reproduce the Bug or Issue
Expected behavior
The value of the textarea to be "static", but instead it is "".
Screenshots or Videos
No response
Platform
Additional context
No response