From 2f3c81e4b213416152921df1b3b82460ae512456 Mon Sep 17 00:00:00 2001 From: pk Date: Fri, 17 Jul 2026 15:59:28 +0200 Subject: [PATCH] Prevent text selection on shift+click row selection --- package.json | 2 +- tp-table.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 5e8db9c..08e5ea0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tp/tp-table", - "version": "1.6.0", + "version": "1.6.1", "description": "", "main": "tp-table.js", "scripts": { diff --git a/tp-table.js b/tp-table.js index 8b9c4d2..071e664 100644 --- a/tp-table.js +++ b/tp-table.js @@ -635,6 +635,10 @@ export class TpTable extends DomQuery(LitElement) { _handleRowClick(e) { if (this.selectionMode !== 'row-click' || !this.selectable) return; + // Prevent the browser's native shift+click text selection since we're + // using shift+click for range selection. + e.preventDefault(); + // Walk through composedPath to find the host, since // lit-virtualizer puts rows in a shadow tree. const itemEl = e.composedPath().find(