Extends SC.Copyable, SC.Freezable, SC.Object.
A simple object representing the selection inside a text field. Each object is frozen and contains exactly three properties: start end length
Important note: In Internet Explorer, newlines in textarea elements are considered two characters. SproutCore does not currently try to hide this from you.
Defined in: text_selection.js
- SproutCore 1.0
- Fields borrowed from SC.Object:
- concatenatedProperties, isDestroyed, isObject, nextProperty, object, property, target, toInvalidate
- Fields borrowed from SC.Observable:
- Fields borrowed from SC.Copyable:
- Fields borrowed from SC.Freezable:
- isFreezable, isFrozen
The direction of the selection. Currently only supported on Chrome, Firefox, and Safari >= 6.
Possible values are 'none' 'forward' 'backward'
- Default value:
The number of characters appearing to the left of the end of the selection.
This will have the same value as 'start' if there is no selection and instead there is only a caret.
The number of characters appearing to the left of the beginning of the selection, starting at 0.
Instance Method Detail
The length of the selection. This is equivalent to (end - start) and exists mainly as a convenience.