Skip to content

Commit f75681e

Browse files
authored
Merge pull request #82 from manuel-EGO/feature/sort-numerically-not-alphabetically
Sort numerically not alphabetically
2 parents 654fcfc + 9c7ea4f commit f75681e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

projects/ng-sortgrid/src/lib/sort/reflection/ngsg-reflect.service.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ export class NgsgReflectService {
1515
const selectedElements = this.ngsgStore.getSelectedItems(key);
1616
const selectedElementIndices = this.getSelectedElementsIndices(selectedElements);
1717
const selectedItems = this.getSelectedItems(items, selectedElementIndices);
18-
const sortedIndices = selectedElementIndices.sort();
18+
const sortedIndices = selectedElementIndices.sort(function(a,b) {
19+
return a - b;
20+
});
1921
const dropIndex = this.findDropIndex(selectedElements, element);
2022

2123
while (sortedIndices.length > 0) {

0 commit comments

Comments
 (0)