Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EuiDataGrid] Issue with reordering columns via drag and drop #8196

Open
agon-qorolli opened this issue Nov 28, 2024 · 2 comments
Open

[EuiDataGrid] Issue with reordering columns via drag and drop #8196

agon-qorolli opened this issue Nov 28, 2024 · 2 comments
Labels

Comments

@agon-qorolli
Copy link

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:

  1. Go to https://codesandbox.io/p/sandbox/gallant-visvesvaraya-v2lfhw?file=%2Fdemo.js%3A50%2C1-58%2C5
  2. Notice different order of initial visibleColumns, vs. columns.map(({id}) => id))
  3. Reorder any column via drag and drop
  4. 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

Image
Image

@agon-qorolli agon-qorolli added bug ⚠️ needs validation For bugs that need confirmation as to whether they're reproducible labels Nov 28, 2024
@agon-qorolli
Copy link
Author

The described issue happens also when programmatically changing visibleColumns, then trying to reorder the columns via drag and drop.

@mgadewoll mgadewoll self-assigned this Dec 2, 2024
@JasonStoltz JasonStoltz removed the ⚠️ needs validation For bugs that need confirmation as to whether they're reproducible label Dec 3, 2024
@mgadewoll
Copy link
Contributor

@agon-qorolli Thanks for raising this!

This can be reproduced and seems to not be specific to mouse drag and drop of columns but also happens for any reordering of columns sharing the same logic (e.g. via the columns reordering popover)

Image

We'll need to check on the overall functionality if a) usages need to be aligned or b) the functionality needs to be aligned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants