react-draggable icon indicating copy to clipboard operation
react-draggable copied to clipboard

how to use onEnd event ?

Open vaynevayne opened this issue 2 years ago • 0 comments

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>

vaynevayne avatar Jun 02 '23 07:06 vaynevayne