Skip to content

fix(InputMenu/Select/SelectMenu): respect trailing: false over default trailingIcon#6457

Merged
benjamincanac merged 1 commit into
nuxt:v4from
Akur1a:fix/select-trailing-false
May 19, 2026
Merged

fix(InputMenu/Select/SelectMenu): respect trailing: false over default trailingIcon#6457
benjamincanac merged 1 commit into
nuxt:v4from
Akur1a:fix/select-trailing-false

Conversation

@Akur1a
Copy link
Copy Markdown
Contributor

@Akur1a Akur1a commented May 18, 2026

Linked issue

Resolves #6287

## What changed

This makes trailing="false" fully opt out of the trailing section, even when a component provides a default trailing icon internally.

Select, SelectMenu, and InputMenu all provide a default chevron through trailingIcon, so the shared icon helper now lets an explicit trailing: false win over that default.

Why

Before this, USelect still rendered the chevron because useComponentIcons treated any trailingIcon as enough reason to show trailing content. That made the public trailing prop feel a bit surprising: passing false did not actually hide the trailing icon.

This keeps the normal default chevron behavior, while allowing users to intentionally remove it.

@Akur1a Akur1a requested a review from benjamincanac as a code owner May 18, 2026 04:21
@github-actions github-actions Bot added the v4 #4488 label May 18, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR fixes a logic bug in useComponentIcons.ts where a truthy trailingIcon prop would force trailing icon positioning even when the trailing prop was explicitly set to false. The fix tightens the isTrailing computation to respect explicit trailing: false. Three new test cases validate that InputMenu, Select, and SelectMenu components correctly omit trailing slot containers and trailing icon elements when trailing is false.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description clearly explains what changed, why it changed, and which components are affected by the modification.
Title check ✅ Passed The title clearly and specifically summarizes the main change: fixing behavior where trailing: false should be respected even when trailingIcon is provided.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 18, 2026

npm i https://pkg.pr.new/@nuxt/ui@6457

commit: 10e5bdb

@benjamincanac benjamincanac changed the title fix(Select): respect trailing false fix(InputMenu/Select/SelectMenu): respect trailing: false when trailingIcon is set May 19, 2026
Copy link
Copy Markdown
Member

@benjamincanac benjamincanac left a comment

Choose a reason for hiding this comment

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

Thanks! 😊

@benjamincanac benjamincanac changed the title fix(InputMenu/Select/SelectMenu): respect trailing: false when trailingIcon is set fix(InputMenu/Select/SelectMenu): respect trailing: false over default trailingIcon May 19, 2026
@benjamincanac benjamincanac merged commit 65b47ce into nuxt:v4 May 19, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v4 #4488

Projects

None yet

Development

Successfully merging this pull request may close these issues.

USelect trailing false doesn't work

2 participants