You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mostly when ordering a table by a column/field, intention by clicking the table header is to start ascending.
In some occasions (e.g. amount of user using a product), it is preferred to sort descending first.
Currently, we work around the issue by checking the incoming order_by parameter during handle_param and after comparing with the state from meta decide to potentially flip the direction for the given column/field. This is ... well ... a work-around and quite fragile/frustrating way, as also LiveView rerender runs into issues.
A good solution could be to modify the derive sortable in a way like below to indicate the intented initial order direction
Thanks for opening the issue. Flop.push_order/3 already allows to modify the directions that are used. I just made a small change in #432 that allows you to use a descending sort order as an initial direction.
You can use this in the table component like this:
Mostly when ordering a table by a column/field, intention by clicking the table header is to start ascending.
In some occasions (e.g. amount of user using a product), it is preferred to sort descending first.
Currently, we work around the issue by checking the incoming
order_by
parameter duringhandle_param
and after comparing with the state frommeta
decide to potentially flip the direction for the given column/field. This is ... well ... a work-around and quite fragile/frustrating way, as also LiveView rerender runs into issues.A good solution could be to modify the
derive sortable
in a way like below to indicate the intented initial order directionThe text was updated successfully, but these errors were encountered: