Fix sort function to work with Safari

Use localeCompare to compare strings instead of '>' so that arrays
sort as expected in Safari.

Bug: Issue 7057
Change-Id: I9c68e12d25df8c227dfb70c383eca8b2d79a25c5
This commit is contained in:
Becky Siegel
2017-08-22 09:24:56 -07:00
parent ae27adc91e
commit 4cc4dc5b8c

View File

@@ -143,7 +143,8 @@ limitations under the License.
value: obj[key],
};
}).sort((a, b) => {
return a.id > b.id;
// Since IDs are strings, use localeCompare.
return a.id.localeCompare(b.id);
});
},
};