Allow passing closures to getBulkActionsTdCheckboxAttributes (see MR #123) #2308
belkri
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I previously opened to make it possible to pass a closure to the getBulkActionsTdCheckboxAttributes method, as it currently only accepts arrays. My use case: I need to access the current row index to generate a proper aria-label for each checkbox for accessibility reasons.
Summary of changes in the MR:
The method now accepts both arrays and closures, ensuring backwards compatibility.
Alternatives considered:
I thought about hardcoding the aria-label in the checkbox component, but this would require accessing the locale and handling language-specific placement of the row index (e.g., English: "select row number {{$row->id}}", German: "Zeile {{$row->id}} auswählen"). This approach is commented out in td/bulk-actions.blade.php and forms/checkbox.blade.php.
Open points:
I have not yet added documentation or new tests, as I’d like to get some feedback before proceeding.
Would love to hear your thoughts on the proposed change and whether you see any issues or improvements.
Thanks!
Reference: #2300
Beta Was this translation helpful? Give feedback.
All reactions