Construct a new InputRange
.
The target input element that contains the content for the range.
The inclusive 0-based start index for the range. Will be adjusted to fit in the input contents.
The exclusive 0-based end index for the range. Will be adjusted to fit in the input contents.
Returns true if the start is equal to the end of this range.
Always returns the containing input element.
Always returns the containing input element.
Always returns the containing input element.
Returns range's start offset.
Returns range's end offset.
Static
fromCreate a new range from the current user selection. If the input is not focused, the range will just be the start
of the input (offsets 0
to 0
).
This can be used to get the caret coordinates: if the resulting range is collapsed
, the location of the
getBoundingClientRect
will be the location of the caret caret (note, however, that the width will be 0
in
this case).
Create a copy of this range.
Get the underlying InputStyleClone
instance powering these calculations. This can be used to listen for
updates to trigger layout recalculation.
Generated using TypeDoc
A fragment of a document that can contain only pieces of a single text node. Does not implement
Range
methods that operate with other nodes or directly mutate the contents of theRange
.