Skip to content

fix(Select,InputWrapper): scope value truncation off bare span selectors - #1351

Open
ignovak wants to merge 2 commits into
mainfrom
fix/scope-value-truncation-selectors
Open

ignovak wants to merge 2 commits into
mainfrom
fix/scope-value-truncation-selectors

Conversation

@ignovak

@ignovak ignovak commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Description

Follow-up to #1302 (Icon wrapper div → span), closing #1303.

Two components truncated text with a bare-element selector, span:first-of-type, ported verbatim from the styled-components era. Because icons are now <span>s, these selectors started matching icon wrappers — the opposite of their intent. This replaces the bare-element targeting with class-scoped targeting.

  • Select — .select-trigger span:first-of-type never truncated the value text: the value is a <div class="ellipsis-content"> (EllipsisContent defaults to a div) that self-truncates, as do .select-value-container (single) and .select-value. The rule was inert before fix(Icon): render wrapper as span for valid inline nesting #1302 and only mis-targeted the sort/item icon spans after it. Removed.
  • InputWrapper — .wrapper span:first-of-type does do real work: it truncates the composed value <span> of the range date pickers, which sits as a direct child of an as="div" InputElement (.input has width:100% but no overflow, so this rule is what clips it). Every icon lives in .start-content/.end-content/.icon-button, never in .input. Scoped to .input > span — same declarations, same target span, icons excluded.

Good to know

Accepted behavior change: NumberField start/end adornment spans (e.g. $, units) are no longer force-truncated (they lose white-space:nowrap + ellipsis) and lay out naturally. Icons share those containers, so truncation can't be kept selectively for adornments; content is short, so this is normally invisible (confirmed: zero visual diffs below). Field values still truncate as before.

Checklist

  • Breaking changes? (add migration notes in changesets)
  • Visual changes? (specify in changesets)
  • Design review needed?

A patch changeset is included. No visual change (see below).

Contribution

  • Sufficient research before PR
  • Self-reviewed the PR
  • Manually tested the changes
  • build and build-storybook work locally
  • Tests and Stories are aligned with the changes

Verified locally: typecheck, lint (0 errors), format, circular-dependency:check, unit tests for the Select + input families (245 passing), build + health check, storybook:build. Visual regression in Docker — 108/108 passing with zero diffs across select, inputfield (incl. NumberField), daterangepicker, datetimerangepicker, datepicker. No snapshots regenerated.

Accessibility

CSS-only; no markup, behavior, or ARIA changes. Icons and field/trigger values render as before.

Screenshots

No visual change — all existing snapshots match with zero diffs.

🤖 Generated with Claude Code


Note

Low Risk
CSS-only selector scoping with patch-level UI behavior (adornment wrapping); no logic, ARIA, or data-path changes, and visual regression reported clean.

Overview
Follow-up to icon wrappers becoming <span> elements: truncation rules that used bare span:first-of-type now target the right nodes only.

Select drops the unused .select-trigger span:first-of-type rule (value text already truncates via EllipsisContent / value container styles; the old selector only hit icon spans after the icon change).

InputWrapper keeps the same ellipsis behavior for range date picker composed values by moving truncation to .input > span, so start/end icon wrappers and adornments outside .input are no longer clipped. NumberField $/unit adornments may layout without forced ellipsis; field values still truncate as before.

Reviewed by Cursor Bugbot for commit 08bfb54. Bugbot is set up for automated code reviews on this repo. Configure here.

Two components truncated text with a bare `span:first-of-type` selector
ported verbatim from styled-components. After #1302 made the Icon wrapper
a <span>, these matched icon wrappers instead of (or in addition to) text.

- Select: `.select-trigger span:first-of-type` never truncated the value
  text (it is a <div class="ellipsis-content"> that self-truncates, as do
  .select-value and .select-value-container). The rule was inert before
  #1302 and only mis-targeted icon spans after, so remove it.
- InputWrapper: `.wrapper span:first-of-type` does truncate the range date
  pickers' composed value <span>, which sits inside an `as="div"` .input.
  Scope the rule to `.input > span` so it keeps truncating that value but
  no longer matches icons (which live in start/end content), nor NumberField
  start/end adornment spans.

Closes #1303

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 08bfb54

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clickhouse/click-ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@workflow-authentication-public

Copy link
Copy Markdown
Contributor

Chromatic Storybook

Check Status Link
Storybook ✅ 672 stories published Open Storybook
UI Tests ✅ 672 tests unchanged Open build

Built from commit: 08bfb5417e43ef24c07dfdb1876a94bf62444fa6 · Chromatic run

Statuses as of the end of the run. The build link shows the live review state.

@workflow-authentication-public

Copy link
Copy Markdown
Contributor

Storybook Preview Deployed

✅ Preview URL: https://click-ro3p0ir31-clickhouse.vercel.app

Built from commit: 60f65c268e7bc40ace246766cf0871d1230b967b

This branch has not been deployed

No deployments
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