Skip to content

FormControlRange Interface #11478

@t-andresre

Description

@t-andresre

What problem are you trying to solve?

The current Range interface methods do not support retrieving or creating Range objects that represent the value (rather than the element itself) of <textarea> and <input> elements.

What solutions exist today?

Currently, if web authors wish to use range-based operations with <textarea> or <input> elements, they must find workarounds, which often involve cloning these elements and their styles into <div>s, which is both difficult to maintain and may impact the web application's performance.

How would you solve it?

The proposed interface provides a way of creating a FormControlRange—a specialized type of Range object—that represents part or all of the value of <textarea> and <input> elements, enabling range-based operations such as getting bounding rects and setting custom highlights, while limiting access to the standard Range API to enforce encapsulation.

Anything else?

This proposal is only scoped to textarea/input element. For other elements, the regular Range interface can already be used for range-based operations.

Link to the explainer for this proposal: FormControlRange

Metadata

Metadata

Assignees

No one assigned

    Labels

    addition/proposalNew features or enhancementsagenda+To be discussed at a triage meetingneeds implementer interestMoving the issue forward requires implementers to express intereststage: 1Incubation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions