Skip to content

Commit

Permalink
Data Explorer: Pass comparator function to correctly sort row/column …
Browse files Browse the repository at this point in the history
…indexes when exporting to clipboard (#3848)

Addresses #3819. `Array.sort` called without a comparator function
results in the values being sorted lexically based on their string
representation.

### QA Notes

Use Command-click (on macOS) or Control-click (Windows/Linux) to select
a subset of rows or columns in the data explorer and copy-paste into a
spreadsheet. The values should appear in the visible order as in the
data grid rather than in the selection order.
  • Loading branch information
wesm authored Jul 3, 2024
1 parent 3dfafda commit b750305
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ class SelectionIndexes {
* @returns The selection indexes as a sorted array.
*/
sortedArray() {
return Array.from(this.indexes).sort();
return Array.from(this.indexes).sort((a, b) => a - b);
}
}

Expand Down

0 comments on commit b750305

Please sign in to comment.