Prevent text selection on shift+click row selection
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@tp/tp-table",
|
"name": "@tp/tp-table",
|
||||||
"version": "1.6.0",
|
"version": "1.6.1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "tp-table.js",
|
"main": "tp-table.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -635,6 +635,10 @@ export class TpTable extends DomQuery(LitElement) {
|
|||||||
_handleRowClick(e) {
|
_handleRowClick(e) {
|
||||||
if (this.selectionMode !== 'row-click' || !this.selectable) return;
|
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 <tp-table-item> host, since
|
// Walk through composedPath to find the <tp-table-item> host, since
|
||||||
// lit-virtualizer puts rows in a shadow tree.
|
// lit-virtualizer puts rows in a shadow tree.
|
||||||
const itemEl = e.composedPath().find(
|
const itemEl = e.composedPath().find(
|
||||||
|
|||||||
Reference in New Issue
Block a user