feat: add col_click attribute to table component for checkbox column

- Add col_click slot attribute to table component that overrides row_click
- Clicking anywhere in the checkbox column now toggles the checkbox
- Clicking other columns still navigates to member details

Closes #223
This commit is contained in:
Moritz 2025-12-03 14:24:10 +01:00
parent 09c75212b2
commit 8e4f1ba674
6 changed files with 71 additions and 60 deletions

View file

@ -58,6 +58,7 @@
<!-- <:col :let={member} label="Id">{member.id}</:col> -->
<:col
:let={member}
col_click={&MvWeb.MemberLive.Index.checkbox_column_click/1}
label={
~H"""
<.input
@ -74,11 +75,7 @@
<.input
type="checkbox"
name={member.id}
phx-click="select_member"
phx-value-id={member.id}
checked={MapSet.member?(@selected_members, member.id)}
phx-capture-click
phx-stop-propagation
aria-label={gettext("Select member")}
role="checkbox"
/>