fix: select all checkbox handling

This commit is contained in:
Simon 2026-01-29 15:14:36 +01:00
parent bb7e3cbe77
commit 124ab295a6
Signed by: simon
GPG key ID: 40E7A58C4AA1EDB2
3 changed files with 41 additions and 26 deletions

View file

@ -17,7 +17,7 @@
type="checkbox"
name="select_all"
phx-click="select_all"
checked={Enum.sort(@selected_users) == Enum.map(@users, & &1.id) |> Enum.sort()}
checked={Enum.sort(@selected_users) == Enum.map(@users, &to_string(&1.id)) |> Enum.sort()}
aria-label={gettext("Select all users")}
role="checkbox"
/>
@ -26,10 +26,10 @@
>
<.input
type="checkbox"
name={user.id}
name={to_string(user.id)}
phx-click="select_user"
phx-value-id={user.id}
checked={user.id in @selected_users}
phx-value-id={to_string(user.id)}
checked={to_string(user.id) in @selected_users}
phx-capture-click
phx-stop-propagation
aria-label={gettext("Select user")}