소스 검색

Table: allow omitting prop if sort-method is provided

Leopoldthecoder 8 년 전
부모
커밋
0966662dc0
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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;