Skip to content

Conversation

@ealipkin
Copy link

  • fix(datatable): preserve keyless columns during reorder
  • Resolves #6764 and #5633
  • Scope: DataTable reorderable-columns logic only
  • Root cause: columns() rebuilt the ordered list purely from d_columnOrder. findColumnByKey treated null order entries as a match for the first column with a falsy key, so selector or frozen columns were duplicated when d_columnOrder contained null placeholders. The final spread (...cols.filter) then re-appended the original keyed column, causing copies to appear after each drag. The same logic also forced keyless columns to the tail of the array when null was used to reserve their position.
  • Fix: tightened findColumnByKey to ignore null or undefined props and process d_columnOrder with a queue of keyless columns so each null placeholder consumes exactly one selector or frozen column in its original sequence. Hidden columns remain skipped and the remainder filter no longer re-adds duplicates.
  • Verification: manual testing with selector plus multi reorder, frozen action column, and multiple null placeholders at the start and end of d_columnOrder. Column count stays stable, keyless columns remain anchored, and hidden columns are still excluded.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Datatable: reorderableColumns

1 participant