SortableJS / react-sortablejs

React bindings for SortableJS
http://sortablejs.github.io/react-sortablejs/
MIT License
2.04k stars 210 forks source link

[bug] ghost, chosen and dragClass do not work with css modules (but i found a fix) #212

Open gregg-cbs opened 3 years ago

gregg-cbs commented 3 years ago

Describe the bug In nextJS we have been forced to use css modules as a means to style things which introduces one huge caveat, css does not work the conventional way, you have to apply the class to an html element up front otherwise the class is not included in the bundle.

This looks like so:

<ReactSortable 
chosenClass={style.categoryItemChosen}

In nextJS i cannot do this:

<ReactSortable 
chosenClass="categoryItemChosen"

But i have found that this works:

<ReactSortable 
chosenClass={`${styles.categoryItemChosen}`}

Maybe this is worth mentioning somewhere in the documentation?