Skip to content

fix(native_select): correct viewBox casing so the default chevron renders#467

Merged
cirdes merged 1 commit into
ruby-ui:mainfrom
pierry01:feat/native-select-icon
Jul 9, 2026
Merged

fix(native_select): correct viewBox casing so the default chevron renders#467
cirdes merged 1 commit into
ruby-ui:mainfrom
pierry01:feat/native-select-icon

Conversation

@pierry01

@pierry01 pierry01 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What & why

The default chevron in NativeSelectIcon was declared with a lowercase viewbox: attribute. Phlex emits attribute keys verbatim, and SVG is case-sensitive — the browser only honors viewBox (camelCase) and silently ignores viewbox. With no viewBox, the 0 0 24 24 path renders in a raw 16px (size-4) coordinate space instead of being scaled to fit, so the chevron came out oversized / clipped.

Since NativeSelect sets appearance-none (stripping the native arrow), this icon is the only dropdown indicator — so the glyph must render correctly.

The fix is a one-character change: viewbox:viewBox:. The lucide chevron and all positioning classes are otherwise unchanged, keeping the component faithful to the shadcn default.

Before / After (rendered HTML)

<!-- before: browser ignores lowercase viewbox → no viewBox → chevron mis-scaled -->
<svg viewbox="0 0 24 24" class="size-4"><path d="m6 9 6 6 6-6"></path></svg>

<!-- after: valid viewBox → chevron scales to the 16px box -->
<svg viewBox="0 0 24 24" class="size-4"><path d="m6 9 6 6 6-6"></path></svg>

Notes

  • mcp/data/registry.json rebuilt via exe/ruby-ui-mcp-build — the only diff is the same viewboxviewBox change in the native_select_icon.rb entry.

Tests

Full gem suite green (264 runs, 0 failures) and standard clean locally on Ruby 3.3.3.

@pierry01 pierry01 force-pushed the feat/native-select-icon branch from caaff38 to faa4447 Compare July 9, 2026 18:35
@pierry01 pierry01 changed the title refactor(native_select): drop hardcoded chevron from NativeSelectIcon fix(native_select): corrige capitalização de viewBox no chevron do NativeSelectIcon Jul 9, 2026
@pierry01 pierry01 changed the title fix(native_select): corrige capitalização de viewBox no chevron do NativeSelectIcon fix(native_select): correct viewBox casing so the default chevron renders Jul 9, 2026
@pierry01 pierry01 marked this pull request as ready for review July 9, 2026 18:38
@pierry01 pierry01 requested a review from cirdes as a code owner July 9, 2026 18:38

@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

@cirdes cirdes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nice catch!

@cirdes cirdes merged commit da0df29 into ruby-ui:main Jul 9, 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.

2 participants