Repository navigation
fix(grouped): scope flex-wrap to narrow viewports (fixes #114) - #170
Merged
Merged
Conversation
Add flex-wrap: wrap to .grouped class to enable responsive wrapping of grouped controls on narrow viewports instead of horizontal overflow. Changes: - src/_form.css: flex-wrap: wrap on .grouped (1 line, 2 gzip bytes) - baselines: update size-baseline.json with 2-byte rationale - test/grouped-controls.html: 9 validation fixtures - test/vrt/grouped-controls.spec.js: 11 tests (3 VRT + 8 assertions) - test/vrt/snapshots: 3 Chromium baselines (desktop/mobile/narrow) Fixes issue #114: grouped controls now wrap vertically on narrow viewports instead of overflowing horizontally. Regression coverage: - Gapless + wrap: no horizontal overflow, border-radius preserved - Mixed controls: no overflow, existing heights preserved (select=36, input=36, button=38) - Disabled controls: opacity 0.4 preserved - Focus outlines: box-shadow visible
Problem: unscoped flex-wrap: wrap on .grouped exposed that Chota inputs have width: 100%, causing inputs to fill the entire row on desktop and push buttons to a second row. This broke existing desktop grouped-control behavior. Fix: scoped media query wrapping. @media (max-width: 480px) { .grouped { flex-wrap: wrap; } } Behavior: - Desktop (>480px): horizontal, no wrapping (existing behavior preserved) - Mobile/Narrow (<480px): wraps to vertical layout (fixes #114) Size impact: 14 gzip bytes (baseline: 3312 → 3326, ceiling: 4096) Rationale: Scoped wrapping avoids the width:100% input issue while still fixing the narrow-viewport overflow. All target browsers support @media. Tests (15/15 pass): - Desktop: horizontal, no wrapping (regression check) - Desktop: all items on same row (y positions match) - Mobile/Narrow: wraps without horizontal overflow - Gapless + wrap: no regression, border-radius preserved - Disabled: opacity 0.4 preserved - Focus: box-shadow visible - Mixed controls: no overflow, existing heights preserved
When grouped controls wrap on narrow viewports, items on the second (and subsequent) rows were touching the row above. Add 16px gap between wrapped rows using flex gap, while keeping gapless groups joined (gap: 0). Changes: - .grouped: gap: 0 16px (horizontal 16px, vertical 0 on desktop) - @media (max-width: 480px): gap: 16px (both directions when wrapping) - .grouped.gapless: gap: 0 (preserve joined borders when wrapping) Size: 3321 bytes (baseline: 3326, ceiling: 4096) — under baseline.
- HTML: 9 fixtures -> 4 (desktop, narrow wrap, gapless wrap, mixed heights) - Spec: 15 tests -> 4 (one per fixture, computed-style + overflow assertions) - Screenshots: 3 full-page -> 4 targeted locator.screenshot() calls - Removed: fullPage screenshots, disabled/focus tests, desktop full-width test - Each test proves its fixture with computed-style and overflow assertions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Scoped
flex-wrap: wrapto narrow viewports via media query. On desktop, grouped controls stay horizontal (existing behavior). On narrow viewports (<480px), items wrap to vertical layout with proper spacing.The Problem (original)
Grouped controls overflowed horizontally on narrow viewports instead of wrapping (issue #114).
The Problem (desktop regression)
Unscoped
flex-wrap: wrapexposed that Chota inputs havewidth: 100%, causing inputs to fill the entire row on desktop and push buttons to a second row.The Fix
Size Impact
Test Results
15/15 tests pass (2 existing VRT + 13 new):
Files Changed
Unresolved