From fd817df8a638fa4cb4a6f880669bfdd80cda86c0 Mon Sep 17 00:00:00 2001 From: Thomas Weber Date: Thu, 17 Jun 2021 11:53:22 -0500 Subject: [PATCH] Ensure list monitor is not selected when scrolled --- src/scaffolding/monitor.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/scaffolding/monitor.js b/src/scaffolding/monitor.js index 6d6eb46..fc4863f 100644 --- a/src/scaffolding/monitor.js +++ b/src/scaffolding/monitor.js @@ -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); }