Skip to content

Commit 415506b

Browse files
authored
README : trick for emptyInsertThreshold
Give a pure-css workaround to emptyInsertThreshold option.
1 parent e83eb7e commit 415506b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,19 @@ The distance (in pixels) the mouse must be from an empty sortable while dragging
521521

522522
Demo: https://jsbin.com/becavoj/edit?js,output
523523

524+
Instead of this, you can just set a padding on your list when it is empty. Warning, for :empty to work, it must have no node inside (even text one).
525+
(It will help if your lists are side-by-side, since you only want the drag occurs when you are under the list - not at the left)
526+
527+
Adding a CSS rule :
528+
`ul:empty {
529+
background:pink;
530+
padding-bottom:3em;
531+
}`
532+
533+
And rewriting the empty list as : `<ul id="list2" class="list-group"></ul>` (so that it is really empty)
534+
535+
You got :
536+
https://jsbin.com/galujuvayi/edit?html,css,js,output
524537

525538
---
526539
### Event object ([demo](https://jsbin.com/fogujiv/edit?js,output))

0 commit comments

Comments
 (0)