-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(useSortable): prevent from creating multi instances #3501
Conversation
9afb592
to
01fee91
Compare
01fee91
to
792bd7d
Compare
We should set |
@Alfred-Skyblue Got you, so I think we need to set the sortable to undefined when the stop function is invoked |
does this inherently then stop from creating recursive groups that can be sorted? I need to implement a functionality that groups items inside, and this group can either render a group item or another group (recursively) - so my logic is to create groups that are sortable and eventual rendering of items when reaching the bottom line. |
@brgkcosic If you need to perform recursive sorting, you should create a separate sortable instance at each level of recursion. |
Before submitting the PR, please make sure you do the following
fixes #123
).Description
fix #3496
prevent start multi instance
Additional context
🤖 Generated by Copilot at 9afb592
This pull request fixes a bug in
onClickOutside
and improves the performance and reliability ofuseSortable
. It ensures that theonClickOutside
function correctly handles null or undefined target elements, and that theuseSortable
function does not create duplicate Sortable instances.🤖 Generated by Copilot at 9afb592
onClickOutside
that caused incorrectshouldListen
value when target element was null or undefined (link)useSortable
by checking if one already exists for the target element (link)