We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 54e0536 commit aa426ecCopy full SHA for aa426ec
src/selection-watcher.js
@@ -22,12 +22,19 @@ export default class SelectionWatcher {
22
this.currentRange = undefined
23
}
24
25
+ /**
26
+ * Updates the internal selection pointer to the current rangy selection.
27
+ */
28
+ syncSelection () {
29
+ this.rangySelection = rangy.getSelection(this.win)
30
+ }
31
+
32
/**
33
* Return a RangeContainer if the current selection is within an editable
34
* otherwise return an empty RangeContainer
35
*/
36
getRangeContainer () {
- this.rangySelection = rangy.getSelection(this.win)
37
+ this.syncSelection()
38
39
// rangeCount is 0 or 1 in all browsers except firefox
40
// firefox can work with multiple ranges
0 commit comments