trilbymedia / grav-plugin-flex-objects

Powerful and supremely flexible object support for Grav
MIT License
40 stars 10 forks source link

Flex Sorting Only works first time or only works in one direction (in Admin) #92

Closed PalmTreeVI closed 3 years ago

PalmTreeVI commented 3 years ago

When I click a header item for example Name it sorts data table in ascending order correctly

But when I click Name again, the ordering does not reverse table into descending order.

The direction icons to right of header item clicked does update accordingly with up or down arrows.

Grav v1.7.0-rc.20 - Admin v1.10.0-rc.2

Here is example screen before clicking a header

Screenshot_2020-12-20_14-08-55

Here is after the first click of Score header

Screenshot_2020-12-20_14-05-54

And finally, a second click of the Score header

Screenshot_2020-12-20_14-06-19

Notice the header direction arrows update accordingly but that the data does not change.

w00fz commented 3 years ago

Thanks for opening this @PalmTreeVI

w00fz commented 3 years ago

I can confirm the issue Matias.

To replicate, go in /admin/accounts/users, sort by username twice and you’ll notice nothing changes. However, I am sending the property sort: username|asc and sort: username|desc accordingly but it’s always returned asc.

mahagr commented 3 years ago

Fixed in https://github.com/getgrav/grav/commit/bc2435efe99b7dac9034c3f18bd33c9a119ca750