Class: SC.TextSelection
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
- Since:
- SproutCore 1.0
Field Summary
- Fields borrowed from SC.Object:
- concatenatedProperties, isDestroyed, isObject, nextProperty, object, property, target, toInvalidate
- Fields borrowed from SC.Observable:
- isObservable
- Fields borrowed from SC.Copyable:
- isCopyable
- Fields borrowed from SC.Freezable:
- isFreezable, isFrozen
Instance Methods
Field Detail
directionThe direction of the selection. Currently only supported on Chrome, Firefox, and Safari >= 6.
Possible values are 'none' 'forward' 'backward'
- Default value:
- 'none'
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.