Skip to content

Conversation

@TkDodo
Copy link
Collaborator

@TkDodo TkDodo commented Nov 20, 2025

almost all CompositeSelect usages pass either a trigger or triggerProps already, which means they never need the default trigger label calculation that is done internally.

In an upcoming perf improvement, this calculation will be changed / removed because it relies on all options being rendered eagerly. This computation can be done in the parent for CompactSelect because all items are available, but CompositeSelect does this with regions so it would be harder. However, we don’t need it if its unused.

This PR just enforces that there won’t be a future usage that uses the default trigger label in CompositeSelect by always enforcing a trigger to be passed. It also unifies triggerLabel & trigger usages, as triggerLabel is no longer allowed.

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 20, 2025
Comment on lines -174 to -176
// Region 1's callback is called, and trigger label is updated
// Region 1's callback is called
expect(region1Mock).toHaveBeenCalledWith({value: 'choice_one', label: 'Choice One'});
expect(screen.getByRole('button', {name: 'Choice One'})).toBeInTheDocument();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: we no longer automatically update trigger labels for CompositeSelect, as we always have to pass in a custom trigger.

@TkDodo TkDodo marked this pull request as ready for review November 20, 2025 09:45
@TkDodo TkDodo requested review from a team as code owners November 20, 2025 09:45
@TkDodo TkDodo merged commit 2281d9b into master Nov 20, 2025
49 checks passed
@TkDodo TkDodo deleted the tkdodo/ref/composite-select-required-trigger branch November 20, 2025 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants