Skip to content

Commit 51c19d7

Browse files
author
pkempenaers
committed
Fixed a bug where sorting on displayProperty was case sensitive
1 parent 080ba0b commit 51c19d7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/app/component/dropdownTree.controller.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,16 @@
7777
if (!vm.settings.sortByDisplayProperty) {
7878
return 0;
7979
}
80+
if (a.type === 'string') {
81+
const aLowerCase = a.value.toLowerCase();
82+
const bLowerCase = b.value.toLowerCase();
83+
if (aLowerCase < bLowerCase) {
84+
return -1;
85+
} else if (aLowerCase > bLowerCase) {
86+
return 1;
87+
}
88+
return 0;
89+
}
8090
if (a.value < b.value) {
8191
return -1;
8292
} else if (a.value > b.value) {

0 commit comments

Comments
 (0)