fix(core): improve table header sorting logic in processTable function (#14797)

Bug Resolved
#14795


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Made row and column sorting deterministic when items share the same
order value, reducing unexpected cell shifts.
* Adjusted comparator behavior to preserve tied-order grouping, which
may change displayed column/row sequence in edge cases.
* Improved consistency of table rendering and cell placement across
refreshes and edits.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Ahsan Khaleeq
2026-04-07 00:33:53 +05:00
committed by GitHub
parent 2ca4973167
commit 156cfc7e76
3 changed files with 12 additions and 12 deletions

View File

@@ -4,3 +4,8 @@ export const cleanSelection = () => {
selection.removeAllRanges();
}
};
export const compareByOrder = <T extends { order: string }>(
a: T,
b: T
): number => (a.order === b.order ? 0 : a.order > b.order ? 1 : -1);