diff --git a/packages/eui/src/components/datagrid/body/header/data_grid_header_cell.tsx b/packages/eui/src/components/datagrid/body/header/data_grid_header_cell.tsx index 12b8ee16e02f..4854c041cc4c 100644 --- a/packages/eui/src/components/datagrid/body/header/data_grid_header_cell.tsx +++ b/packages/eui/src/components/datagrid/body/header/data_grid_header_cell.tsx @@ -309,17 +309,17 @@ export const EuiDataGridHeaderCell: FunctionComponent {({ draggableProps, dragHandleProps }, { isDragging }) => { const { - role, + role, // extracting role to not pass it along 'aria-describedby': ariaDescribedby, ...restDragHandleProps } = dragHandleProps ?? {}; @@ -334,7 +334,6 @@ export const EuiDataGridHeaderCell: FunctionComponent { if (!source || !destination) return; + if (destination.index === source.index) { + return; + } + const indexOffset = leadingControlColumns?.length ?? 0; const sourceColumn = columns[source.index - indexOffset]; const destinationColumn = columns[destination.index - indexOffset]; @@ -112,7 +122,8 @@ const EuiDataGridHeaderRow = memo( {columnDragDrop ? (