Skip to content

Latest commit

 

History

History
53 lines (40 loc) · 1.22 KB

README.md

File metadata and controls

53 lines (40 loc) · 1.22 KB

<sortable-list>

Polymer 1.X and 2.X custom element for drag-and-drop reorder of items.

For typical use just wrap your dom-repeat template item with a <sortable-list> element to get drag-and-drop reordering.

Relies on HTML 5 drag and drop browser support, so if you need to support older browsers which do not support HTML 5 drag and drop events then we suggest using a polyfill:

https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills

Install

bower install --save polymer-sortable-list

Usage

<sortable-list>
  <template is="dom-repeat" items='["item 1","item 2","item 3","item 4"]'>
    <div style="height:30px;cursor:pointer;">[[item]]</div>
  </template>
</sortable-list>

Viewing This Element

First, make sure you have the Polymer CLI installed. Then run polymer serve to serve this element locally.

$ polymer serve

Running Tests

$ polymer test