Skip to content

refactor: Always render the Input field wrapper - #5126

Merged
vvaliyev merged 1 commit into
mainfrom
input-field-wrapper
Oct 14, 2026
Merged

vvaliyev merged 1 commit into
mainfrom
input-field-wrapper

Conversation

@vvaliyev

@vvaliyev vvaliyev commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Description

Input now always renders a wrapper (div.input-field) around the native <input>. The wrapper paints the field (border, background, shadow, all states); the native input is borderless and only owns text styles.

Before, the native input painted the field on its own, and a separate container took over when prefix/suffix was set, so every state block existed twice in styles.scss. Now there is one set of surface rules on the field and one set of text rules on the input. CSS is ~4 KB smaller.

Public API and test-utils are unchanged. Two things to know:

  • The native input's bounding box is 1px smaller on each side (it no longer carries the border). Two integ tests that measured it now measure the field, and Autosuggest measures its dropdown width on the Input root.
  • The 1px border itself is not a click target, same as prefix/suffix inputs already behaved.

Rendering matches main except four fixes that fall out of the change:

  • Focused read-only Input shows its focus ring (the read-only rule was clobbering it).
  • Focused type=email/url with an invalid value shows its focus ring (.input:invalid { box-shadow: none }, meant for Firefox's glow, removed it too).
  • Focused Input with prefix/suffix no longer paints square corners over the rounded border.
  • v1 style prop with prefix/suffix behaves like a plain Input.

How has this been tested?

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new field styles override grouped-control corner rules, breaking joined Input and Autosuggest borders.

1 open finding
What changed in this PR

Refactors Input so its field wrapper consistently owns borders, state styling, and sizing.

Changes:

  • Always renders the Input field wrapper.
  • Updates Autosuggest sizing and outside-click handling.
  • Expands tests for field styling and interaction states.
File Description
src/​input/​internal.tsx Always renders the field wrapper.
src/​input/​styles.scss Moves visual states onto the wrapper.
src/​internal/​components/​autosuggest-input/​index.tsx Observes and tracks the input container.
src/​input/​__tests__/​adornments.test.tsx Tests wrapper behavior and styling.
src/​select/​__tests__/​filter.test.tsx Updates the border-radius assertion.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/input/styles.scss Resolved
@codecov

codecov Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.72%. Comparing base (8bbfddc) to head (880690c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5126      +/-   ##
==========================================
- Coverage   97.72%   97.72%   -0.01%     
==========================================
  Files         995      995              
  Lines       32138    32129       -9     
  Branches    11861    11851      -10     
==========================================
- Hits        31408    31399       -9     
  Misses        684      684              
  Partials       46       46              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Field-border clicks can no longer reopen a focused autosuggest after Escape.

1 open finding
1 resolved since last review

🧠 Review effort: Balanced

Comment thread src/input/internal.tsx Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The implementation is coherent and covered by existing visual tests; only a non-blocking comment cleanup remains.

2 open findings

🧠 Review effort: Balanced

Comment thread src/input/internal.tsx Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The cross-browser visual and interaction impact of the CSS and DOM restructuring requires final human validation.

0 open findings

2 resolved since last review

🧠 Review effort: Balanced

georgylobko
georgylobko previously approved these changes Oct 14, 2026
@vvaliyev

Copy link
Copy Markdown
Member Author

/override-visual-regression Expected: the four Input fixes listed in the description (focus states readonly/native-invalid/suffix/prefix entries, style-permutations #21);

@vvaliyev
vvaliyev added this pull request to the merge queue Oct 14, 2026
Merged via the queue into main with commit f8711f6 Oct 14, 2026
86 of 88 checks passed
@vvaliyev
vvaliyev deleted the input-field-wrapper branch October 14, 2026 13:57

This branch was successfully deployed

3 active deployments
dev-pages-react18 — 880690cf Deployed Oct 14, 2026 by vvaliyev via deploy (React 18) / deploy #2781
dev-pages-react16 — 880690cf Deployed Oct 14, 2026 by vvaliyev via deploy (React 16) / deploy #2781
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.

3 participants