Skip to content

fix(Select/SelectMenu/InputMenu): add fallback for max-height#6503

Merged
benjamincanac merged 2 commits into
v4from
fix/select-menu-virtualize-regression
May 26, 2026
Merged

fix(Select/SelectMenu/InputMenu): add fallback for max-height#6503
benjamincanac merged 2 commits into
v4from
fix/select-menu-virtualize-regression

Conversation

@benjamincanac
Copy link
Copy Markdown
Member

🔗 Linked issue

Closes #6490

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

The max-h on popper content relied on --reka-*-content-available-height which chains to --reka-popper-available-height. floating-ui sets that variable asynchronously, so on the initial render it's undefined — the min() expression becomes invalid and max-height drops to none. Without a bounded container the virtualizer renders every item at once.

Adds 15rem as the var() fallback so the constraint holds before floating-ui positions the element, matching the original fixed max-h-60.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

The `max-h` on popper content relied on `--reka-*-content-available-height`
which chains to `--reka-popper-available-height`. floating-ui sets that
variable asynchronously, so on the initial render it's undefined — the
`min()` expression becomes invalid and `max-height` drops to `none`.
Without a bounded container the virtualizer renders every item at once.

Add `15rem` as the `var()` fallback so the constraint holds before
floating-ui positions the element, matching the original fixed `max-h-60`.

Closes #6490
@benjamincanac benjamincanac changed the title fix(SelectMenu,Select,InputMenu): add CSS var fallback for max-height fix(Select/SelectMenu/InputMenu): add CSS var fallback for max-height May 26, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 26, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds CSS variable fallbacks to three theme files (input-menu.ts, select-menu.ts, and select.ts) that define dropdown and menu content styling. Each file's slots.content class string is updated to use explicit fallback values (15rem) for max-height CSS variables when unset. Additionally, select-menu.ts includes an origin-(--reka-combobox-content-transform-origin) class for transform origin control. The changes standardize dropdown content height computation across the UI components.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the bug, root cause (async floating-ui), impact on virtualization, and the solution with fallback values.
Linked Issues check ✅ Passed The PR successfully addresses issue #6490 by adding CSS variable fallbacks (15rem) to restore max-height constraints before floating-ui positions elements, enabling virtualization.
Out of Scope Changes check ✅ Passed All changes are scoped to three theme files and directly address the regression fix by adding CSS variable fallbacks for max-height.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately describes the main change: adding fallback values for max-height in CSS variables across three theme files (Select, SelectMenu, InputMenu).

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/select-menu-virtualize-regression

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.

@benjamincanac benjamincanac changed the title fix(Select/SelectMenu/InputMenu): add CSS var fallback for max-height fix(Select/SelectMenu/InputMenu): add fallback for max-height May 26, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 26, 2026

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

commit: 4fa3e59

@benjamincanac benjamincanac merged commit f4d7cbe into v4 May 26, 2026
24 checks passed
@benjamincanac benjamincanac deleted the fix/select-menu-virtualize-regression branch May 26, 2026 14:11
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.

Major regression: Virtualize on USelectMenu stopped working in 4.8.0

1 participant