Skip to content

Commit 4411a02

Browse files
jenstroegerpeyerluk
authored andcommitted
feat(selection): Add a toString() helper function.
1 parent 39ca54d commit 4411a02

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/selection.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ export default class Selection extends Cursor {
5555
return this.range.toCharacterRange(this.host)
5656
}
5757

58+
// Return a plain string of the current selection content.
59+
toString () {
60+
return this.range.toString()
61+
}
62+
5863
// Get the ClientRects of this selection.
5964
// Use this if you want more precision than getBoundingClientRect can give.
6065
getRects () {

0 commit comments

Comments
 (0)