From 83baf8c7779766c4b949721976b42ed229d48179 Mon Sep 17 00:00:00 2001 From: Lucas Garron Date: Mon, 9 Jan 2023 11:55:08 -0800 Subject: [PATCH 1/2] Set the version field to `0.0.0-development`. The publication workflow will set the version based on the tag of a created GitHub release: https://github.com/github/task-lists-element/blob/70675e8c39a455107870b38e87866e2d6ce6f8b6/.github/workflows/publish.yml --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index dd35f76..9a5eb0c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@github/task-lists-element", - "version": "2.0.2", + "version": "0.0.0-development", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 48a6c46..5bdeccc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@github/task-lists-element", - "version": "2.0.2", + "version": "0.0.0-development", "description": "Drag and drop task list items.", "repository": "github/task-lists-element", "main": "dist/task-lists-element.js", From e5a43ceba142da5cd702434a282fc5b7a5fb40f1 Mon Sep 17 00:00:00 2001 From: Kylie Stradley <4666485+KyFaSt@users.noreply.github.com> Date: Mon, 13 Feb 2023 16:27:01 -0500 Subject: [PATCH 2/2] Fix task list drag Fixes https://github.com/github/primer/issues/1787 --- src/task-lists-element.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/task-lists-element.ts b/src/task-lists-element.ts index db484d8..e87ede5 100644 --- a/src/task-lists-element.ts +++ b/src/task-lists-element.ts @@ -74,19 +74,25 @@ export default class TaskListsElement extends HTMLElement { } const handleTemplate = document.createElement('template') -const span = handleTemplate.content.appendChild(document.createElement('span')) +const span = document.createElement('span') span.classList.add('handle') -const svg = span.appendChild(document.createElement('svg')) + +const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg') svg.classList.add('drag-handle') svg.setAttribute('aria-hidden', 'true') svg.setAttribute('width', '16') svg.setAttribute('height', '16') -const path = svg.appendChild(document.createElement('path')) + +const path = document.createElementNS('http://www.w3.org/2000/svg', 'path') path.setAttribute( 'd', 'M10 13a1 1 0 100-2 1 1 0 000 2zm-4 0a1 1 0 100-2 1 1 0 000 2zm1-5a1 1 0 11-2 0 1 1 0 012 0zm3 1a1 1 0 100-2 1 1 0 000 2zm1-5a1 1 0 11-2 0 1 1 0 012 0zM6 5a1 1 0 100-2 1 1 0 000 2z' ) +handleTemplate.content.appendChild(span) +span.appendChild(svg) +svg.appendChild(path) + const initialized = new WeakMap() // Only top-level lists are draggable, and nested lists drag with their parent item.