Skip to content

Conversation

belkri
Copy link

@belkri belkri commented Sep 17, 2025

Currently, it is not possible to pass a closure to the getBulkActionsTdCheckboxAttributes method, as it only accepts arrays. For my project, I need to pass the current row index in order to display an appropriate aria-label for each checkbox.

Changes:

The method has been adapted to accept both arrays and closures, ensuring backwards compatibility.

Alternative Considered:

Hardcoding the aria-label in the checkbox component was considered. However, this approach would require accessing the locale and handling language-specific placement of the row index, which varies (e.g., English: "select row number {{$row->id}}", German: "Zeile {{$row->id}} auswählen"). This alternative is commented out in td/bulk-actions.blade.php and forms/checkbox.blade.php.

I have not yet added documentation or new tests, as I would like to get your feedback on the proposed changes first.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests and did you add any new tests needed for your feature?
  2. Did you update all templates (if applicable)?
  3. Did you add the relevant documentation (if applicable)?
  4. Did you test locally to make sure your feature works as intended?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@matzeschmitt
Copy link
Contributor

Hello 👋

It would be great to start a discussion here because we also have the task to make the tables more accessible in regards of accessibility.

Thanks you!

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

Successfully merging this pull request may close these issues.

2 participants