Skip to content

feat(BulkSelect): extend onSelect with second parameter source#913

Merged
karelhala merged 7 commits into
patternfly:mainfrom
raswonders:feat/bulkselect-source
May 12, 2026
Merged

feat(BulkSelect): extend onSelect with second parameter source#913
karelhala merged 7 commits into
patternfly:mainfrom
raswonders:feat/bulkselect-source

Conversation

@raswonders
Copy link
Copy Markdown
Contributor

What this does

onSelect now receives an optional second argument: source

onSelect is still (value: BulkSelectValue, source?: BulkSelectSource) => void. The first argument is unchanged: the same BulkSelectValue as today (none, page, all, nonePage, depending on pagination and which action the user chose).

The optional second argument tells which control triggered the callback:

'dropdown' — the user picked an option fron the bulk-select menu (e.g. “Select none”, “Select page”, “Select all”).
'checkbox' — the user toggled the split menu toggle checkbox (the quick select/deselect for the current page vs not paginated “all” behavior, as before).

Why we need this

We're trying to implement slightly different handling when the action comes from the dropdown menu vs the checkbox. The original API doesn't allow this.

Backward compatibility

Existing onSelect handlers that only take value keep working; the extra argument is optional at the type level and is ignored at runtime if not used.

@patternfly-build
Copy link
Copy Markdown

patternfly-build commented Apr 20, 2026

Comment thread packages/module/src/BulkSelect/BulkSelect.tsx Outdated
Comment thread packages/module/src/BulkSelect/BulkSelect.tsx Outdated
Comment thread packages/module/src/BulkSelect/BulkSelect.tsx Outdated
@raswonders raswonders force-pushed the feat/bulkselect-source branch from 30472c2 to c167e9d Compare April 30, 2026 16:18
@raswonders raswonders force-pushed the feat/bulkselect-source branch from c167e9d to 15dc1e1 Compare April 30, 2026 16:22
@raswonders raswonders requested a review from karelhala April 30, 2026 17:20
@karelhala karelhala merged commit 6e65645 into patternfly:main May 12, 2026
6 checks passed
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 6.4.0-prerelease.20 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants