Răsfoiți Sursa

Table: allow omitting prop if sort-method is provided

Leopoldthecoder 8 ani în urmă
părinte
comite
0966662dc0
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  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') {
   if (typeof reverse === 'string') {
     reverse = reverse === 'descending' ? -1 : 1;
     reverse = reverse === 'descending' ? -1 : 1;
   }
   }
-  if (!sortKey) {
+  if (!sortKey && !sortMethod) {
     return array;
     return array;
   }
   }
   const order = (reverse && reverse < 0) ? -1 : 1;
   const order = (reverse && reverse < 0) ? -1 : 1;