Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataTable supports name prop for selectable variant #2085

Open
metonym opened this issue Jan 19, 2025 · 0 comments · May be fixed by #2087
Open

DataTable supports name prop for selectable variant #2085

metonym opened this issue Jan 19, 2025 · 0 comments · May be fixed by #2087

Comments

@metonym
Copy link
Collaborator

metonym commented Jan 19, 2025

If we can, I suggest taking this opportunity to provide a solution that affords progressive enhancement:

  • Have the name attribute be defined by the component consumers; perhaps exposed as a prop, that way every Radio button in the table has a matching name to be gathered server-side via formData.get('school')
  • Have the value attribute match the given Row's ID, available in row.id

In this way, a DataTable can be wrapped in <form> and be submittable without JS.

Originally posted by @theetrain in #2082 (comment)

For a selectable or radio selectable table, the checkbox/input should all have the same name value and encode the toggled value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant