Skip to content

fix(textarea): place initial caret at end - #31582

Open
Elements2720 wants to merge 1 commit into
ionic-team:mainfrom
Elements2720:fix/textarea-caret-position
Open

Elements2720 wants to merge 1 commit into
ionic-team:mainfrom
Elements2720:fix/textarea-caret-position

Conversation

@Elements2720

Copy link
Copy Markdown

Summary

Fixes #31579

ion-textarea now renders its initial value through the native value property instead of a text child, matching ion-input.

This makes setFocus() place the initial caret at the end and preserves an existing selection during unrelated renders.

Evidence

  • Before: an initial value rendered as textarea text content and setFocus() placed the caret at position 0.
  • After: focused caret regression passed with selection [11, 11].
  • Selection-preservation regression passed with selection [1, 4] after an unrelated render.
  • Focused Mobile Chrome e2e: 4 passed.
  • Related input and textarea specs: 17 passed.
  • Core build: passed.
  • Full npm test: one unrelated existing failure in src/components/datetime/test/disabled/datetime.spec.tsx (expected 4 picker columns, received 3); all other reported suites passed.

Merge Danger

Door: two-way

Blast Radius: textarea

The change is limited to native textarea value initialization and its regression coverage.

@Elements2720
Elements2720 requested a review from a team as a code owner October 16, 2026 16:19
@vercel

vercel Bot commented Oct 16, 2026

Copy link
Copy Markdown

@Elements2720 is attempting to deploy a commit to the Ionic Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the package: core @ionic/core package label Oct 16, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: (textarea) initial value leaves caret at start unlike ion-input

1 participant