Ensure list monitor is not selected when scrolled

This commit is contained in:
Thomas Weber committed 2021-06-24 14:09:00 -05:00
1 parent 2eb9ec75c6
commit fd817df8a6
1 file changed
+9
+9
View File
@@ -257,6 +257,15 @@ class ListMonitor extends Monitor {
}
_onscroll (e) {
// If the list monitor is selected, we'll unselect it because the selection won't work properly.
if (window.getSelection) {
const selection = getSelection();
if (selection && (this.rowsInner.contains(selection.anchorNode) || this.rowsInner.contains(selection.focusNode))) {
if (selection.empty) {
selection.empty();
}
}
}
this.scrollTop = e.target.scrollTop;
this.updateValue(this.value);
}