Skip to content

Commit 4fd1f77

Browse files
jenstroegermarcbachmann
authored andcommitted
feat(selection): Add isWrappable() helper function.
1 parent 3de9554 commit 4fd1f77

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/selection.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ export default class Selection extends Cursor {
6060
return this.range.toString()
6161
}
6262

63+
// Return true if the selection can be wrapped, i.e. all open nodes
64+
// are closed within this selection.
65+
isWrappable () {
66+
return content.isWrappable(this.range)
67+
}
68+
6369
// Get the ClientRects of this selection.
6470
// Use this if you want more precision than getBoundingClientRect can give.
6571
getRects () {

0 commit comments

Comments
 (0)