From 6ebf3183a01937b5529b771edc727fea049a4cfd Mon Sep 17 00:00:00 2001 From: gargroh <42495927+gargroh@users.noreply.github.com> Date: Thu, 9 Jan 2020 18:47:12 +0530 Subject: [PATCH] [useSort] Add sort order custom sortMethod (#1615) Added sort order as parameter for calling sortMethod(will be useful to provide more control in custom sortMethod) --- src/plugin-hooks/useSortBy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugin-hooks/useSortBy.js b/src/plugin-hooks/useSortBy.js index a58c626357..60c0305d0f 100755 --- a/src/plugin-hooks/useSortBy.js +++ b/src/plugin-hooks/useSortBy.js @@ -296,7 +296,7 @@ function useInstance(instance) { // Return the correct sortFn. // This function should always return in ascending order - return (a, b) => sortMethod(a, b, sort.id) + return (a, b) => sortMethod(a, b, sort.id, sort.desc) }), // Map the directions availableSortBy.map(sort => {