You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Form::Controls::Textarea and you type in the textarea the value and defaultValue of the underlying textarea get out of sync with each other, so further updates to @value update the defaultValue but the value isn't updated and the textarea doesn't visually update.
This appears to be because the @value set up like <textarea>{{@value}}</textarea> which is technically setting the defaultValue rather than setting the value property like <textarea value={{@value}}>
The <textarea> element specifies its content differently in HTML and JavaScript contexts:
In HTML, the initial content of a <textarea> is specified between its opening and closing tags, not as a value attribute.
In JavaScript, <textarea> elements have a value property that can be used to get or set the current content, and defaultValue to get and set its initial value (equivalent to accessing the HTML element's text content).
When using
Form::Controls::Textarea
and you type in the textarea thevalue
anddefaultValue
of the underlying textarea get out of sync with each other, so further updates to@value
update thedefaultValue
but thevalue
isn't updated and the textarea doesn't visually update.This appears to be because the
@value
set up like<textarea>{{@value}}</textarea>
which is technically setting thedefaultValue
rather than setting thevalue
property like<textarea value={{@value}}>
Relevant snippet from MDN
Example of the problem
Steps:
.value
and.defaultValue
The text was updated successfully, but these errors were encountered: