Skip to content

[Improvement] Combobox: configurable popover placement - #480

Merged
djalmaaraujo merged 3 commits into
ruby-ui:mainfrom
pierry01:feat/combobox-configurable-placement
Jul 15, 2026
Merged

[Improvement] Combobox: configurable popover placement#480
djalmaaraujo merged 3 commits into
ruby-ui:mainfrom
pierry01:feat/combobox-configurable-placement

Conversation

@pierry01

@pierry01 pierry01 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Related issue

No related issue — small enhancement.

Description

The combobox popover is currently pinned to bottom-start (hardcoded in combobox_controller.js). This makes it awkward to embed a combobox where there's no room below the trigger — e.g. nested inside another popover/menu, or near the bottom of the viewport.

This adds a placement value to the Stimulus controller and a matching placement: argument to the Combobox component, forwarded via data-ruby-ui--combobox-placement-value. It's passed straight to Floating UI's computePosition, so any Floating UI placement works (bottom-start, left-start, top, etc.).

Fully backward compatible: the default stays bottom-start, so existing comboboxes render exactly as before.

# default (unchanged)
RubyUI.Combobox(term: "Categories") { ... }

# open to the left
RubyUI.Combobox(term: "Categories", placement: "left-start") { ... }
Before After
Popover always opens bottom-start Popover placement is configurable (default still bottom-start)

pierry01 and others added 2 commits July 15, 2026 10:42
Adds a `placement` value (default `bottom-start`, unchanged behavior) so
consumers can position the popover differently, e.g. `left-start`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Jean Pierry <pierrybm@gmail.com>
@pierry01
pierry01 marked this pull request as ready for review July 15, 2026 13:49
@pierry01
pierry01 requested a review from cirdes as a code owner July 15, 2026 13:50

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 2 files

Re-trigger cubic

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@djalmaaraujo
djalmaaraujo merged commit 4848241 into ruby-ui:main Jul 15, 2026
8 checks passed
@djalmaaraujo djalmaaraujo mentioned this pull request Aug 5, 2026
djalmaaraujo added a commit that referenced this pull request Aug 5, 2026
Bump RubyUI to 1.6.0 (minor: new component + new component options since v1.5.0).

- gem/lib/ruby_ui.rb → 1.6.0; regenerate gem/ and docs/ Gemfile.lock
- docs home hero badge → headline features (InputOtp, Combobox placement)
- rebuild mcp/data/registry.json

Highlights since v1.5.0:
- New component: InputOtp (#456)
- Combobox: configurable popover placement (#480), CheckboxGroup reuse for required ComboboxCheckbox (#479)
- DataTable: custom label + initial column visibility in DataTableColumnToggle (#466)
- Popover: data-state/data-side, clear closeTimeout on disconnect, close on Escape (#495)
- Accordion: no longer clips content that grows after opening (#500, #490)
- Toast: toaster state initialized in initialize() so server-rendered toasts don't throw (#499)
- Docs: Stimulus controllers symlinked to gem source, no more hand-copied drift (#493)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants