mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-08 23:15:24 +02:00
Change sort direction to be a LinkComponent outside of the form for better sort behavior
This commit is contained in:
parent
dfef2897e0
commit
edd048f791
1 changed files with 7 additions and 10 deletions
|
@ -46,17 +46,14 @@
|
|||
{},
|
||||
class: "min-w-[120px] bg-container rounded border-primary cursor-pointer text-primary text-sm w-auto",
|
||||
data: { auto_submit_form_target: "auto", autosubmit_trigger_event: "change" } %>
|
||||
<%= form.hidden_field :direction, value: (@direction == "asc" ? "desc" : "asc") %>
|
||||
<%= render ButtonComponent.new(
|
||||
variant: :icon,
|
||||
icon: "arrow-up-down",
|
||||
size: :sm,
|
||||
type: "submit",
|
||||
title: "Toggle sort direction"
|
||||
) do %>
|
||||
<span class="sr-only">Toggle sort direction</span>
|
||||
<% end %>
|
||||
<%= form.hidden_field :direction, value: @direction %>
|
||||
<% end %>
|
||||
<%= render LinkComponent.new(
|
||||
href: rules_path(direction: @direction == "asc" ? "desc" : "asc", sort_by: @sort_by),
|
||||
variant: "icon",
|
||||
icon: "arrow-up-down",
|
||||
title: "Toggle sort direction"
|
||||
) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-1">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue