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
{{ message }}
Repository navigation
bug: (textarea) initial value leaves caret at start unlike ion-input #31579
In textarea.tsx, the native textarea receives its value as a text child, whereas input.tsx uses the native value property:
<textarea>{value}</textarea>
Use the same property-based approach as ion-input, keeping all other attributes unchanged:
<textareavalue={value}/>
We tested this change in the installed Ionic 8.7.11 bundle (@ionic/core/dist/esm/ion-textarea.entry.js): add value: value to the native textarea properties and remove the value child argument.
In an isolated browser test without the workaround, the caret then starts at 7, and an existing selection survives an unrelated render. The patch also resolved the reported application behavior.
Verified on 9.0.9. ion-textarea passes its starting value to the native <textarea> as text content, while ion-input sets the native value property. Browsers only move the caret to the end when the value property is set, so a textarea that has never been focused keeps its caret at position 0, and setFocus() focuses it there.
Your workaround works. Run it on the first focus only: if it runs on every setFocus() call, it overwrites a selection the user made before the field lost focus.
Activity
thetaPC commentedon Oct 22, 2026
Thanks for the report!
Verified on 9.0.9.
ion-textareapasses its startingvalueto the native<textarea>as text content, whileion-inputsets the nativevalueproperty. Browsers only move the caret to the end when thevalueproperty is set, so a textarea that has never been focused keeps its caret at position 0, andsetFocus()focuses it there.Your workaround works. Run it on the first focus only: if it runs on every
setFocus()call, it overwrites a selection the user made before the field lost focus.Tracked as a bug in
core.