Skip to content
Please note that GitHub no longer supports Internet Explorer.

We recommend upgrading to the latest Microsoft Edge, Google Chrome, or Firefox.

Learn more
Drag and drop task list items.
Branch: master
Clone or download
Latest commit 493d3d2 Feb 22, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples Index list items within their parent list Sep 6, 2018
src
test Index list items within their parent list Sep 6, 2018
.eslintrc.json
.flowconfig
.gitignore
.travis.yml
LICENSE Initial <task-lists> element Apr 25, 2018
README.md Update for modern browsers Feb 20, 2019
package-lock.json 0.3.0 Feb 22, 2019
package.json 0.3.0 Feb 22, 2019
prettier.config.js
rollup.config.js Update for modern browsers Feb 20, 2019

README.md

<task-lists> element

Drag and drop task list items.

Installation

$ npm install --save @github/task-lists-element

Usage

import '@github/task-lists-element'
<task-lists sortable>
  <ul class="contains-task-list">
    <li class="task-list-item">
      <input type="checkbox" class="task-list-item-checkbox">
      Hubot
    </li>
    <li class="task-list-item">
      <input type="checkbox" class="task-list-item-checkbox">
      Bender
    </li>
  </ul>

  <ul class="contains-task-list">
    <li class="task-list-item">
      <input type="checkbox" class="task-list-item-checkbox">
      BB-8
    </li>
    <li class="task-list-item">
      <input type="checkbox" class="task-list-item-checkbox">
      WALL-E
    </li>
  </ul>
</task-lists>

Events

const list = document.querySelector('task-lists')

list.addEventListener('task-lists:check', function(event) {
  const {position, checked} = event.detail
  console.log(position, checked)
})

list.addEventListener('task-lists:move', function(event) {
  const {src, dst} = event.detail
  console.log(src, dst)
})

Browser support

Browsers without native custom element support require a polyfill.

  • Chrome
  • Firefox
  • Safari
  • Microsoft Edge

Development

npm install
npm test

License

Distributed under the MIT license. See LICENSE for details.

You can’t perform that action at this time.