react-sortablejs icon indicating copy to clipboard operation
react-sortablejs copied to clipboard

How to use filter option?

Open morozovkirill opened this issue 5 years ago • 2 comments

Hi.

I'm trying to exclude some items from sorting. So, I use "filtered: true" option. But nothing happens.

Here is sandbox example - https://codesandbox.io/s/peaceful-agnesi-qupz4?file=/src/App.js

morozovkirill avatar Sep 28 '20 13:09 morozovkirill

You probably gave up, or found another way.. I spend some time trying to make it work.. So I'll leave an example for any other lost soul.

<ReactSortable list={listItems} filter={".static"} >
    <Component />
    <Component className={"static"} />
    <Component className={"static"} />
</ReactSortable>

This will disable movement of the 2nd and 3rd component, but the 1st can get between or bellow them. #184

bozhich avatar Nov 21 '20 17:11 bozhich

My lost soul thanks you @bozhich !

aurels avatar Dec 18 '23 12:12 aurels