react-sortable-hoc icon indicating copy to clipboard operation
react-sortable-hoc copied to clipboard

lockAxis removes lockToContainerEdges from the sortable container?

Open TheBloperM opened this issue 4 years ago • 3 comments

Hi! I am attempting to create a sortable container whose draggable can move by the y axis and will be contained to the container

<SortableContainer axis='y' lockAxis='y' lockToContainerEdges={true} items={items} onSortEnd={onSortEnd} helprClass={css.sortableHelper}/>

When attempting this, the draggables can move only in the Y axis but they can be dragged allover the window, outside the container's edges.

image

And when I try to remove lockAxis the drag becomes invisible and successfully sorts the items as I drag the invisible item.

<SortableContainer axis='y' lockToContainerEdges={true} items={items} onSortEnd={onSortEnd} helprClass={css.sortableHelper}/>

image

Removing only axis = 'y' has me remaining in the original state from before.

Is there a way to fix this problem? Thanks in advance!

TheBloperM avatar Aug 02 '21 13:08 TheBloperM

I got the same issue +1

adil-alimbetov avatar Sep 20 '21 12:09 adil-alimbetov

change axis='y' to axis='xy'

lichengri008 avatar May 20 '22 13:05 lichengri008

still not working

IsFive avatar Oct 27 '22 05:10 IsFive