Add text-editor API to get selection range

This commit is contained in:
Toby Zerner 2015-06-01 08:49:46 +09:30
parent 78efdc1d09
commit 605eaa6ffc

View File

@ -61,6 +61,11 @@ export default class TextEditor extends Component {
$textarea.focus();
}
getSelectionRange() {
var $textarea = this.$('textarea');
return [$textarea[0].selectionStart, $textarea[0].selectionEnd];
}
insertAtCursor(insert) {
var textarea = this.$('textarea')[0];
var content = this.value();