Skip to content

Commit

Permalink
Example on how to get selected text
Browse files Browse the repository at this point in the history
  • Loading branch information
securingsincity committed May 28, 2017
1 parent 8cecf02 commit f041342
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,18 @@ render(
);
```

## How do I add custom completers?
## How do I get selected text `onSelectionChange`?

How you extract the text from the editor is based on how to call methods on the editor.

Your `onSelectionChange` should look like this:

```javascript
onSelectionChange(selection) {
const content = this.refs.aceEditor.editor.session.getTextRange(selection.getRange());
// use content
}
```

## How do I add markers?
```javascript
Expand Down

0 comments on commit f041342

Please sign in to comment.