Skip to content

Standardize a way to scroll into view within text controls #6217

Open
@saschanaz

Description

@saschanaz

While several selection setter APIs including setSelectionRange() allows selection inside text controls ( and <textarea>), there is no straightforward way to scroll to the selected range without hacks.

Gecko has a nonstandard behavior where those APIs always scroll to the internal focus offset, and I'd like to standardize this behavior:

  • Specify what Gecko does (always scroll to the internal focus offset)
  • Or, add a parameter to setSelectionRange: setSelectionRange(start, end, { scroll: true, direction })
  • Or, add a method scrollToFocus()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions