fix(combobox): make TriggerInput caret button clickable#387
fix(combobox): make TriggerInput caret button clickable#387mattrothenberg merged 3 commits intomainfrom
Conversation
The trigger button had p-0 and its icon child was absolutely positioned relative to the outer wrapper, causing the button to collapse to 0x0 pixels. This made it impossible to click programmatically (e.g., in Playwright tests). Fix: Move absolute positioning to the button itself so it wraps the icon and has a proper 16x16 clickable area. Keep m-0/p-0/bg-transparent to reset Stratus global button styles. Also adds browser tests for Combobox Playwright interactions.
commit: |
Docs PreviewCommit: |
|
/bonk review |
Review for PR #387I've reviewed the changes. Here's my assessment: SummaryThis PR fixes a real usability issue where the Code Changes
Visual RegressionThe VR report shows 6 screenshots with minor pixel changes (~0.5-1.5%), all related to Combobox components. These are expected given the positioning change. The diffs look reasonable. Approval✅ Approve - This is a well-scoped fix with good test coverage. The solution is minimal and follows existing patterns in the codebase (similar to Table's button reset approach). One minor observation: Test at line 210 is titled "trigger button has zero size due to p-0" which describes the bug being fixed, but the test itself just verifies the button exists and logs dimensions. Consider renaming it to something like "trigger button is accessible and clickable" to better reflect its purpose post-fix. |


















Summary
Problem
The trigger button (caret icon) in
Combobox.TriggerInputhadp-0with its icon child absolutely positioned relative to the outer wrapper. This caused the button to collapse to 0x0 pixels, making it impossible to click programmatically.Scott Gardner reported this issue - he couldn't locate a clickable trigger when writing Playwright tests.
Solution
Move the absolute positioning from the inner
<ComboboxBase.Icon>to the<ComboboxBase.Trigger>button itself. The button now wraps the icon and has a proper 16x16 clickable area.Keep
m-0 bg-transparent p-0to reset Stratus global button styles (as used elsewhere, e.g., Table).Bonk
Tests
Added
combobox.browser.test.tsxwith 9 browser tests covering Playwright interactions including trigger button clicking.