Explorar o código

Table: allow omitting prop if sort-method is provided

Leopoldthecoder %!s(int64=8) %!d(string=hai) anos
pai
achega
0966662dc0
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      packages/table/src/util.js

+ 1 - 1
packages/table/src/util.js

@@ -21,7 +21,7 @@ export const orderBy = function(array, sortKey, reverse, sortMethod) {
   if (typeof reverse === 'string') {
     reverse = reverse === 'descending' ? -1 : 1;
   }
-  if (!sortKey) {
+  if (!sortKey && !sortMethod) {
     return array;
   }
   const order = (reverse && reverse < 0) ? -1 : 1;