Skip to content

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

Closed

Description

@agon-qorolli

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

Activity

  1. added
    ⚠️ needs validation
    on Nov 28, 2024
  2. agon-qorolli commented on Nov 28, 2024

    @agon-qorolli
    Author

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

  3. self-assigned this
    on Dec 2, 2024
  4. removed
    ⚠️ needs validation
    on Dec 3, 2024
  5. mgadewoll commented on Dec 17, 2024

    @mgadewoll
    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.

  6. self-assigned this
    on Feb 17, 2025
  7. umbopepato commented on Sep 8, 2025

    @umbopepato
    Member

    Hey! Now that we've enabled the columns visibility toggles in the columns popover of the alerts table, this issue is being noticed more and more by solutions and customers (see elastic/kibana#229352 for example).

    I'm trying to introduce a temporary mitigation on our side (keeping the columns sorted according to visibleColumns), but changing the columns prop is already causing a number of other issues (see elastic/kibana#221757 (comment) for example) so it doesn't feel like a very solid fix...

    Are there any plans to address this on the EUI side?

  8. cnasikas commented on Sep 14, 2025

    @cnasikas
    Member
  9. mgadewoll commented on Sep 15, 2025

    @mgadewoll
    Contributor

    @umbopepato Thanks for letting us know that this bug is surfacing in more places 🙏

    The investigation into this bug has not been planned previously, but considering that it causes more trouble we will prioritize investigating this bug and possible solutions.
    cc @JasonStoltz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions