Describe the bug
Reordering columns via drag and drop doesn't work correctly, when initial visibleColumns have different order than columns: EuiDataGridColumn[].
A valid use case of different order of visibleColumns, might be persisted orders.
Impact and severity
Is there an end-user impact caused by this bug? Not sure.
Is there a known workaround? Reorder columns: EuiDataGridColumn[] also, might not be optimal.
Environment and versions
- EUI version: 98.1.0
- React version: 18.2.0
- Kibana version (if applicable): N/A
- Browser: Chrome
- Operating System: macOS
To Reproduce
Steps to reproduce the behavior:
- Go to https://codesandbox.io/p/sandbox/gallant-visvesvaraya-v2lfhw?file=%2Fdemo.js%3A50%2C1-58%2C5
- Notice different order of initial
visibleColumns, vs. columns.map(({id}) => id))
- Reorder any column via drag and drop
- See error. Other columns get reordered also.
Expected behavior
When initial visibleColumns have different order than columns, reordering a column via drag and drop should change the order of only the dragged column.
Minimum reproducible sandbox
https://codesandbox.io/p/sandbox/gallant-visvesvaraya-v2lfhw?file=%2Fdemo.js%3A50%2C1-58%2C5
Screenshots


Describe the bug
Reordering columns via drag and drop doesn't work correctly, when initial
visibleColumnshave different order thancolumns: EuiDataGridColumn[].A valid use case of different order of
visibleColumns, might be persisted orders.Impact and severity
Is there an end-user impact caused by this bug? Not sure.
Is there a known workaround? Reorder
columns: EuiDataGridColumn[]also, might not be optimal.Environment and versions
To Reproduce
Steps to reproduce the behavior:
visibleColumns, vs.columns.map(({id}) => id))Expected behavior
When initial
visibleColumnshave different order thancolumns, reordering a column via drag and drop should change the order of only the dragged column.Minimum reproducible sandbox
https://codesandbox.io/p/sandbox/gallant-visvesvaraya-v2lfhw?file=%2Fdemo.js%3A50%2C1-58%2C5
Screenshots