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
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