clauderic / clauderic/react-sortable-hoc

lockToContainerEdges not working as expected

Open
#676 1 comment 4 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
10.9k
Forks
959
PR merge metrics
No merged PRs in 30d

Description

I have a sample code on codesandbox to illustrate simple usage of `lockToContainerEdges`. It is working here.

https://codesandbox.io/s/vigorous-morning-9sb87

However, using similar codes in my project, it doesn't work. I can drag items outside of the `sortableContainer`. I even tried to use `getContainer` to ensure it is using the right parent container, but it still allows item to be dragged outside. The main difference I can think of is: the component which contains draggable codes are being rendered by JSONSchema form.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by comparing the working CodeSandbox example with the project setup, focusing on lockToContainerEdges and getContainer when the draggable component is rendered by JSONSchema form. Reproduce the case and determine why items can leave the sortableContainer; done means the existing usage keeps dragged items within that container.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.