@@ -332,15 +332,26 @@ export function Table({
332332 } , [ resizingColumn , displayColumns , columnWidths ] )
333333
334334 const dropIndicatorLeft = useMemo ( ( ) => {
335- if ( ! dropTargetColumnName ) return null
335+ if ( ! dropTargetColumnName || ! dragColumnName ) return null
336+
337+ const dragIdx = displayColumns . findIndex ( ( c ) => c . name === dragColumnName )
338+ const targetIdx = displayColumns . findIndex ( ( c ) => c . name === dropTargetColumnName )
339+
340+ if ( dragIdx !== - 1 && targetIdx !== - 1 ) {
341+ // Suppress when drop would be a no-op (same effective position)
342+ if ( targetIdx === dragIdx ) return null
343+ if ( dropSide === 'right' && targetIdx === dragIdx - 1 ) return null
344+ if ( dropSide === 'left' && targetIdx === dragIdx + 1 ) return null
345+ }
346+
336347 let left = CHECKBOX_COL_WIDTH
337348 for ( const col of displayColumns ) {
338349 if ( dropSide === 'left' && col . name === dropTargetColumnName ) return left
339350 left += columnWidths [ col . name ] ?? COL_WIDTH
340351 if ( dropSide === 'right' && col . name === dropTargetColumnName ) return left
341352 }
342353 return null
343- } , [ dropTargetColumnName , dropSide , displayColumns , columnWidths ] )
354+ } , [ dropTargetColumnName , dropSide , displayColumns , columnWidths , dragColumnName ] )
344355
345356 const isAllRowsSelected = useMemo ( ( ) => {
346357 if ( checkedRows . size > 0 && rows . length > 0 && checkedRows . size >= rows . length ) {
0 commit comments