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

Merged
PI
4mo ago
+2-2

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 viewbox → viewBox 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.