Skip to content

fix(input-group): added mb-0 to prevent layout shifts in stratus#456

Merged
mattrothenberg merged 1 commit intocloudflare:mainfrom
najlaskr:input-group-label
Apr 28, 2026
Merged

fix(input-group): added mb-0 to prevent layout shifts in stratus#456
mattrothenberg merged 1 commit intocloudflare:mainfrom
najlaskr:input-group-label

Conversation

@najlaskr
Copy link
Copy Markdown
Contributor

Fixes a margin issues in stratus when InputGroup renders as a label by adding mb-0


  • Reviews
    • bonk has reviewed the change
    • automated review not possible because: no access to bonk
  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows: ran pnpm typecheck, pnpm test and pnpm build, verified through browser devtools
    • Additional testing not necessary because:

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 28, 2026

npm i https://pkg.pr.new/@cloudflare/kumo@456

commit: 94863e6

@github-actions
Copy link
Copy Markdown
Contributor

Docs Preview

View docs preview

Commit: 94863e6

@github-actions
Copy link
Copy Markdown
Contributor

Visual Regression Report — 1 changed, 9 unchanged

1 screenshot(s) with visual changes:

Input Group / Input Group Loading

5 px (0%) changed

Before After Diff
Before After Diff
9 screenshot(s) unchanged
  • Input Group / Input Group
  • Input Group / Input Group Icons
  • Input Group / Input Group Text
  • Input Group / Input Group Buttons
  • Input Group / Input Group Tooltip Button
  • Input Group / Input Group Kbd
  • Input Group / Input Group Suffix
  • Input Group / Input Group Sizes
  • Input Group / Input Group States

Generated by Kumo Visual Regression

@mattrothenberg
Copy link
Copy Markdown
Collaborator

/bonk

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented Apr 28, 2026

Based on my review of PR #456, here's a summary:

PR Summary

Title: fix(input-group): added mb-0 to prevent layout shifts in stratus

Changes: Adds !mb-0 to three <label> elements in the InputGroup component to prevent inherited label margins from causing layout shifts in Stratus.

Files Changed:

  1. .changeset/input-group-label-margin-reset.md (new changeset)
  2. packages/kumo/src/components/input-group/input-group.tsx (3 lines modified)

Review

The fix targets three locations where <label> elements are rendered in InputGroup:

  1. Line 223 - Invisible label overlay in hybrid mode (when label prop is provided)
  2. Line 286 - Invisible label overlay in container mode (when label prop is provided)
  3. Line 296 - Standalone container mode wrapper (when rendering as a native <label>)

The use of !mb-0 (important) is appropriate here because:

  • These are structural/layout labels, not content labels
  • They need to override any inherited label margins from parent stylesheets or CSS resets
  • The labels are either invisible overlays (aria-hidden="true") or wrapper elements where margins would break layout calculations

Visual Regression: The 5px change detected in "Input Group / Input Group Loading" is expected and confirms the fix is working - it shows the margin is now being properly reset.

Changeset: ✅ Properly documented with patch level bump

PR Checklist: ✅ Properly filled out with valid justifications

This is a clean, targeted fix that addresses the root cause without introducing side effects. The change is minimal and follows the project's conventions.

github run

@mattrothenberg mattrothenberg merged commit fa991d9 into cloudflare:main Apr 28, 2026
15 checks passed
@najlaskr najlaskr deleted the input-group-label branch April 28, 2026 20:18
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