Skip to content
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

how to use onEnd event ? #719

Open
vaynevayne opened this issue Jun 2, 2023 · 0 comments
Open

how to use onEnd event ? #719

vaynevayne opened this issue Jun 2, 2023 · 0 comments

Comments

@vaynevayne
Copy link

setList not well work with group list,
This is a very common requirement, but react-dragablesjs doesn't work, I think it needs the onEnd event, how do I do it? Also, the main reason might be that he has two setList's to execute, when in reality, only one is needed, like in other sort libraries, and the logic is only done in the onEnd event

  const leftColumns = useMemo(() => {
    return []
  }, [columnsState])

  const centerColumns = useMemo(() => {
    return []
  }, [columnsState])

  const setLeftColumns = (list) => {

    setColumnsState(newColumnsState)
  }

  const setCenterColumns = (list) => {
  
    setColumnsState(newColumnsState)
  }


<ReactSortable
            animation={150}
            group="shared-group-name"
            list={leftColumns}
            setList={setLeftColumns}
          ></ReactSortable>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant