You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Replace fragile bare-span truncation selectors in InputWrapper and Select with class-based targeting #1303
Both apply max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;.
Because #1302 changed the Icon wrapper from <div> to <span>, those selectors now also match icon wrappers rendered inside these components (e.g. the TextField loading/clear icons, the Select sort icon). Today this is visually neutral — Chromatic shows zero diffs, since the styles are inert on a span that wraps a fixed-size SVG with no text — so it is not a current regression. It is a latent fragility: a future icon with state padding/background or a focus ring in one of these slots could be clipped by overflow: hidden.
Why a separate PR
The selectors legitimately truncate text spans (e.g. EllipsisContent, consumer-provided start/end content), and icons are now spans too, so this cannot be a one-line fix:
Scoping Select to .select-value excludes the sort icon but not a start-positioned item icon nested inside the value.
InputWrapper's .wrapper span:first-of-type has no single CUI text element that clearly owns it; it appears to primarily truncate consumer-provided start/end content (or is partly vestigial).
Doing it right means re-pointing truncation at the intended text element via a class and re-validating truncation across TextField, PasswordField, SearchField, DatePicker, and single/multi Select, with its own visual baseline. That is out of scope for the focused icon fix (one concern per PR).
Proposed work
Give the truncated text element a dedicated class in each component and target that, instead of span:first-of-type.
Confirm icon wrappers no longer match the truncation rules.
Re-run the visual specs for all affected components; any snapshot change must be intended and explained.
Acceptance
No bare-element (span / div) selectors remain for truncation in InputWrapper or Select.
Truncation behavior is unchanged (visual specs green, zero unexplained diffs).
Note: these selectors are live — repoint, do not remove
Investigated whether .wrapper span:first-of-type is vestigial. It is not safe to delete:
InputWrapper.wrapper span:first-of-type truncates the date-range value: DateRangePickerInput / DateTimeRangePickerInput (src/components/DatePicker/Common.tsx) render the formatted range as a <span> (formattedValue), and this rule ellipsizes it. Covered by tests/display/daterangepicker.spec.ts. It also affects consumer-supplied span startContent/endContent (e.g. NumberField$).
Select.select-trigger span:first-of-type truncates the EllipsisContent value-text span in the trigger.
History: the InputWrapper rule was introduced in #55 (Aug 2023) and carried verbatim through the SCSS and CSS-Modules migrations. The Icon wrapper was a div from that same era until #1302 changed it to a span, which is why these selectors only started matching icon wrappers now.
So the fix is to point truncation at the real text element via a class (the DateRange formattedValue span; the Select value text), not to remove the rule. Keep daterangepicker.spec.ts, the Select specs, and NumberField start/end-content stories green as the guardrail.
InputWrapper: add a .wrapper__value class (with an InputValue slot next to InputStartContent/InputEndContent) and use it for the date-range value in DatePicker/Common.tsx, then drop .wrapper span:first-of-type.
Select: it looks like the trigger's text already truncates through .select-value-container and EllipsisContent (which renders a div), so .select-trigger span:first-of-type seems to only hit the sort and option icons. I'd remove it and rely on the visual specs to confirm nothing changes.
One question: consumer-provided span startContent/endContent would stop truncating. Is that OK?
Activity
ignovak commentedon Nov 12, 2026
Note: these selectors are live — repoint, do not remove
Investigated whether
.wrapper span:first-of-typeis vestigial. It is not safe to delete:.wrapper span:first-of-typetruncates the date-range value:DateRangePickerInput/DateTimeRangePickerInput(src/components/DatePicker/Common.tsx) render the formatted range as a<span>(formattedValue), and this rule ellipsizes it. Covered bytests/display/daterangepicker.spec.ts. It also affects consumer-supplied spanstartContent/endContent(e.g.NumberField$)..select-trigger span:first-of-typetruncates theEllipsisContentvalue-text span in the trigger.History: the InputWrapper rule was introduced in #55 (Aug 2023) and carried verbatim through the SCSS and CSS-Modules migrations. The
Iconwrapper was adivfrom that same era until #1302 changed it to aspan, which is why these selectors only started matching icon wrappers now.So the fix is to point truncation at the real text element via a class (the DateRange
formattedValuespan; the Select value text), not to remove the rule. Keepdaterangepicker.spec.ts, the Select specs, andNumberFieldstart/end-content stories green as the guardrail.oranjan commentedon Nov 28, 2026
Hi @ignovak, I'd like to take this one. My plan:
.wrapper__valueclass (with anInputValueslot next toInputStartContent/InputEndContent) and use it for the date-range value inDatePicker/Common.tsx, then drop.wrapper span:first-of-type..select-value-containerandEllipsisContent(which renders adiv), so.select-trigger span:first-of-typeseems to only hit the sort and option icons. I'd remove it and rely on the visual specs to confirm nothing changes.startContent/endContentwould stop truncating. Is that OK?Does that match what you had in mind?
oranjan commentedon Nov 28, 2026
withdrawing since #1331 already covers this