diff --git a/packages/table/src/util.js b/packages/table/src/util.js index 4f92debfc..c415fb718 100644 --- a/packages/table/src/util.js +++ b/packages/table/src/util.js @@ -28,7 +28,8 @@ export const orderBy = function(array, sortKey, reverse, sortMethod) { // sort on a copy to avoid mutating original array return array.slice().sort(sortMethod ? function(a, b) { - return sortMethod(a, b) ? order : -order; + const result = sortMethod(a, b); + return result === 0 ? 0 : result > 0 ? order : -order; } : function(a, b) { if (sortKey !== '$key') { if (isObject(a) && '$value' in a) a = a.$value;