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

Draggable row table of PatternFly 4 threw an error when I drag table row in horizon direction then move in vertical direction

Open judy20191103 opened this issue 4 years ago • 6 comments

I have a question about Draggable row table of PatternFly 4. when I dragged one table row in horizontal direction out of the table, and it still in origin place . Then I dragged the table row in vertical direction, the page was crashed and threw an error: "TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'." I found that thrown from the move function of the demo code. This issue can repeat stably. can you have a try and fix this issue?

judy20191103 avatar Dec 30 '21 01:12 judy20191103

I think I have found the reason of this issue: we shuold initialize tempItemOrder's value is the same as itemOrder, like below: useEffect(() => { setItemOrder(props.rows.map((r) => r.id.toString())); setTempItemOrder(props.rows.map((r) => r.id.toString())) }, [props.rows]); otherwise, when we trigger onDragOver event in 'if' condition(drag table row in horizontal direction), the tempItemOrder value is [], then we drag the table tow in vertical direction, triggering the onDragOver event 'else' condition, but the tempItemOrder is [], so the move function threw an error for its empty array without attribute id.

judy20191103 avatar Dec 31 '21 01:12 judy20191103

This will likely be addressed when we tackle this issue: https://github.com/patternfly/patternfly-react/issues/6531

nicolethoen avatar Jan 14 '22 19:01 nicolethoen

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Mar 15 '22 23:03 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar May 15 '22 21:05 stale[bot]

Still plan to address this when we tackle this issue: https://github.com/patternfly/patternfly-react/issues/6531

nicolethoen avatar May 31 '22 12:05 nicolethoen

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Jul 30 '22 13:07 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Sep 30 '22 16:09 stale[bot]