From 4cc4dc5b8ceeda14e85a5b5bb742ff22db0b0250 Mon Sep 17 00:00:00 2001 From: Becky Siegel Date: Tue, 22 Aug 2017 09:24:56 -0700 Subject: [PATCH] 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 --- .../app/behaviors/gr-access-behavior/gr-access-behavior.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/polygerrit-ui/app/behaviors/gr-access-behavior/gr-access-behavior.html b/polygerrit-ui/app/behaviors/gr-access-behavior/gr-access-behavior.html index 907c480426..4e67fda341 100644 --- a/polygerrit-ui/app/behaviors/gr-access-behavior/gr-access-behavior.html +++ b/polygerrit-ui/app/behaviors/gr-access-behavior/gr-access-behavior.html @@ -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); }); }, };