-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
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