Skip to content

Text selection after updating textContent of TEXTAREA #2411

@tkent-google

Description

@tkent-google

The specification says:
https://html.spec.whatwg.org/multipage/forms.html#the-textarea-element:textcontent

When the textarea element's textContent IDL attribute changes value, if the element's dirty value flag is false, then the element's raw value must be set to the value of the element's textContent IDL attribute.

This paragraph doesn't mention text selection. I confirmed Chrome, Edge, Firefox, and Safari set text selection to the end of the new value. So I propose to update the paragraph like the value setter.

https://html.spec.whatwg.org/multipage/forms.html#dom-textarea-value

and should then move the text entry cursor position to the end of the text control, unselecting any selected text and resetting the selection direction to none.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions