Skip to content

fix(input): render error and description without requiring label#513

Merged
mattrothenberg merged 2 commits into
mainfrom
fix/input-error-without-label
May 14, 2026
Merged

fix(input): render error and description without requiring label#513
mattrothenberg merged 2 commits into
mainfrom
fix/input-error-without-label

Conversation

@mattrothenberg
Copy link
Copy Markdown
Collaborator

Summary

  • Bug fix: Input and InputArea silently dropped error and description props when no label was provided, because the <Field> wrapper was only rendered in the if (label) branch
  • Fix: Changed the guard to if (label || error || description) so the Field wrapper renders whenever there's content to display
  • Cleanup: Extracted normalizeFieldError() helper to deduplicate the string | object error normalization repeated 7x across components

Reported by Ana Foppa -- passing error as a prop to Input without a label showed the red ring but no error message text.

  • Reviews
  • bonk has reviewed the change
  • automated review not possible because: bug fix requires human review of behavioral change
  • Tests
  • Tests included/updated

Input and InputArea silently dropped error and description props when
no label was provided, because the Field wrapper was only rendered in
the label branch. Now the Field wrapper renders whenever label, error,
or description is present.

Extracts normalizeFieldError helper to deduplicate the string-to-object
error conversion used across multiple components.
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 14, 2026

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

commit: 9c35031

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

Docs Preview

View docs preview

Commit: 55a8ba4

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

Visual Regression Report — 13 changed, 25 unchanged

13 screenshot(s) with visual changes:

Button / Loading State

3 px (0%) changed

Before After Diff
Before After Diff

Dialog / Dialog With Actions

251 px (0.25%) changed

Before After Diff
Before After Diff

Dialog / Dialog With Select

130 px (0.13%) changed

Before After Diff
Before After Diff

Dialog (Open)

0 px (0%) changed

Before After Diff
Before After Diff

Select / Select Basic

530 px (0.52%) changed

Before After Diff
Before After Diff

Select / Select Sizes

812 px (0.44%) changed

Before After Diff
Before After Diff

Select / Select Without Label

105 px (0.1%) changed

Before After Diff
Before After Diff

Select / Select With Field

635 px (0.54%) changed

Before After Diff
Before After Diff

Select / Select Loading

1,429 px (0.71%) changed

Before After Diff
Before After Diff

Select / Select Grouped

346 px (0.34%) changed

Before After Diff
Before After Diff

Select / Select Grouped With Disabled

736 px (0.72%) changed

Before After Diff
Before After Diff

Select / Select Long List

898 px (0.76%) changed

Before After Diff
Before After Diff

Select (Open)

538 px (0%) changed

Before After Diff
Before After Diff
25 screenshot(s) unchanged
  • Button / Basic
  • Button / Variant: Primary
  • Button / Variant: Secondary
  • Button / Variant: Ghost
  • Button / Variant: Destructive
  • Button / Variant: Outline
  • Button / Variant: Secondary Destructive
  • Button / Sizes
  • Button / With Icon
  • Button / Icon Only
  • Button / Disabled State
  • Button / Title
  • Button / Link as Button
  • Dialog / Dialog Basic
  • Dialog / Dialog Alert
  • Dialog / Dialog Confirmation
  • Dialog / Dialog With Combobox
  • Dialog / Dialog With Dropdown
  • Select / Select Placeholder
  • Select / Select With Tooltip
  • Select / Select Custom Rendering
  • Select / Select Multiple
  • Select / Select Complex
  • Select / Select Disabled Options
  • Select / Select Disabled Items

Generated by Kumo Visual Regression

@mattrothenberg
Copy link
Copy Markdown
Collaborator Author

/bonk review and approve

Copy link
Copy Markdown
Contributor

@ask-bonk ask-bonk Bot left a comment

Choose a reason for hiding this comment

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

LGTM! Clean bug fix that properly renders error and description props without requiring a label. The normalizeFieldError() helper is a good DRY improvement, and test coverage is thorough.

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented May 14, 2026

Review submitted and approved for PR #513.

The fix correctly addresses the bug where error and description props were being silently dropped when no label was provided. The new normalizeFieldError() helper is a clean refactor that reduces code duplication across the 7 components that handle error normalization.

github run

@mattrothenberg mattrothenberg merged commit 93d04bd into main May 14, 2026
16 checks passed
@mattrothenberg mattrothenberg deleted the fix/input-error-without-label branch May 14, 2026 13:35
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.

1 participant