From 1ad5f6bb35c71156ee93ccaedae1c877f71faacd Mon Sep 17 00:00:00 2001 From: pk Date: Sat, 11 Nov 2023 13:05:31 +0100 Subject: [PATCH] Add options --- package.json | 4 ++-- tp-sortable.js | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ea2a95c..2e83519 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tp/tp-sortable", - "version": "1.0.0", + "version": "1.0.1", "description": "", "main": "tp-sortable.js", "scripts": { @@ -13,7 +13,7 @@ "author": "trading_peter", "license": "Apache-2.0", "dependencies": { - "lit": "^2.2.0", + "lit": "^2.8.0", "sortablejs": "^1.15.0" } } diff --git a/tp-sortable.js b/tp-sortable.js index 731a17a..2aa2ed2 100644 --- a/tp-sortable.js +++ b/tp-sortable.js @@ -52,6 +52,8 @@ class TpSortable extends LitElement { firstUpdated() { this.sortable = Sortable.create(this.querySelector('[slot="list"]'), { animation: 150, + draggable: this.selector, + handle: this.handle, onSort: e => { this.dispatchEvent(new CustomEvent('sorting-changed', { detail: e, bubbles: true, composed: true })); }