Skip to content

feat!: v11 root-and-refs (className, style and ref on the root) - #3301

Closed
interactivellama wants to merge 58 commits into
feat/v11-p1-5-labels-namingfrom
feat/v11-p1-6-root-and-refs
Closed

interactivellama wants to merge 58 commits into
feat/v11-p1-5-labels-namingfrom
feat/v11-p1-6-root-and-refs

Conversation

@interactivellama

@interactivellama interactivellama commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #3298

Additional description

Theme 6 of the v11 P1 prop-freeze review (root-and-refs). className, style, id and ref go on the real root element. Parts get className* props, and ref is the only ref API. Renamed props keep working, warn once, and lose to the new prop when both are passed.

Component Change
breadcrumb style and className on the root nav; styleContainer deprecated
button ref goes to the <button>; buttonRef deprecated (internal callers migrated)
builder-header (breaking) className/style on the real root instead of a hard-coded wrapper
card classNameBody replaces bodyClassName (deprecated)
color-picker consumer id on the root
combobox (breaking) className on the root .slds-form-element; classNameCombobox for the inner .slds-combobox; classNameContainer deprecated; ref now gets a DOM node
date-picker (breaking) className on the root instead of the dialog; classNameMenu, classNameTrigger (replaces triggerClassName); ref goes to the root
checkbox className on the root of every variant
input (breaking) ref goes to the <input>, not the wrapper; style replaces styleContainer; inputRef deprecated; new classNameInput; Search forwards ref
menu-dropdown ref goes to the trigger button; requestFocus deprecated
pill ref is the root element, not an imperative handle
pill-container (breaking) root listbox gets the consumer id (no -listbox-of-pill-options suffix)
progress-bar (breaking) className on the root; classNameBar for the role="progressbar" element
radio ref goes to the <input>; refs.input deprecated
radio-group (breaking) className on the fieldset; classNameControl for the control div
setup-assistant (breaking) id/className on the real root in each mode
simple-data-table (breaking) className on the outermost element; classNameTable for the <table>
toast ref goes to the root; ToastContainer className typed as a string
tooltip classNameTrigger, styleTrigger, classNameDialog replace the trigger*/dialog* names (deprecated)
trial-bar TrialBarButton merges consumer className/style instead of overriding them
tabs ref goes to the root div
visual-picker ref goes to the fieldset
welcome-mat InfoBadge className typed like other components and merged into the root class

Migration lines are in the CHANGELOG (### Changed) and in each BREAKING CHANGE: footer.

Decisions

  • Every rename is a compatible deprecation (it works and warns once).
  • The breaking changes are the ones where the existing name now lands on a different element, which can't be aliased.
  • Combobox and date-picker ref point at the wrapper div. Retyping or retargeting them is noted for theme 7 (typing), along with the links VisualPicker not attaching its ref.

Full list in .planning/v11-p1/6-root-and-refs.md.

Review

  • npm run test:ci passes: 1660 tests, 0 lint errors.
  • TinyNod ran on push (advisory, base master, so it also covered themes 3–5) and reported 5 findings, all judged false positives:
    • The 4 info findings are naming and bundle-size noise.
  • A local code review found no defects in this theme's commits.

CONTRIBUTOR checklist

  • npm run lint 0 errors, npm run typecheck clean, npm test -- --run passes, npm run build succeeds
  • Tests added for new props and fixes; snapshots regenerated
  • Storybook a11y panel not checked

Button keeps the requestFocus/onRequestFocus pair working, but both are
marked @deprecated and warn once. They were not deprecated in 0.10.x, so
v11 deprecates them instead of removing them.

SimpleDataTableInteractiveElement now focuses forwardRef components
(Button, Checkbox, the internal link, which is now forwardRef) through
`ref`. Other wrapped components, such as MenuDropdown in row actions,
still receive requestFocus/onRequestFocus.
…lbacks

#3251 already passes the triggering event (or undefined from the autoplay timer) to onRequestPanelChange and onRequestAutoplayToggle. The existing key-path test only checked that the event was truthy, which an empty object also passes.
Handlers that read a consumer's events object through the ref stay stable,
although that object is usually new on every render.
…the validators

- events.onClose, onOpen, onRequestClose and onRequestOpen were typed but
  ignored. They are now called. The top-level props of the same names
  still work, are called after their events counterparts, and warn once.
- events.onRequestClose fires before the popover closes, so a controlled
  parent can keep it open. data.trigger is typed
  ColorPickerRequestCloseTrigger.
- events.onValidateColor/onValidateWorkingColor return a value, so they
  are not events. They become the top-level validateColor and
  validateWorkingColor props. The old keys still work and warn once.
- Handlers read events through useLatestRef, and the events default is
  a module constant, so a new events object no longer rebuilds them.
events was merged into a new object on every render and listed in the
dependencies of every handler, so each render rebuilt requestOpen,
requestClose, the key and input handlers, and everything that depended
on them. The handlers now read the latest events through a ref.
Checkbox keeps the requestFocus/onRequestFocus pair working, but both
are marked @deprecated and warn once. They were not deprecated in
0.10.x, so v11 deprecates them instead of removing them. Focus the
checkbox through `ref`, which is forwarded to the `<input>`.
Radio keeps the requestFocus/onRequestFocus pair working, but both are marked @deprecated
and checkDeprecatedProps warns once. They were not deprecated in 0.10.x, so v11 deprecates
them instead of removing them. Focus the radio through `refs.input`: keep the `<input>` it
receives and call `.focus()`.
onSort was called as (data, event) and RowActions onAction as
(item, option). Both now follow the (event, data) convention:
onSort(event, { property, sortDirection }) and
onAction(event, { item, option }). onLoadMore, which took no arguments,
now receives (event, { trigger }). The examples and tests use the new
signatures. The deprecated onChange(selection, event) is unchanged; it
already warns and points to onRowChange.

BREAKING CHANGE: SimpleDataTable onSort is called as
onSort(event, { property, sortDirection }) instead of
onSort({ property, sortDirection }, event), and SimpleDataTableRowActions
onAction as onAction(event, { item, option }) instead of
onAction(item, option).
…out an event

When the calendar moves focus because a new month rendered, there is no
DOM event. onCalendarFocus now gets `undefined` for it, like
SimpleDataTable onLoadMore and onFixedHeaderResize, instead of `null`.
Keyboard moves still pass the keydown event.

BREAKING CHANGE: DatePicker onCalendarFocus receives `undefined`, not
`null`, as `event` after a month change. Replace `event === null` with
`!event` or `event === undefined`.
onClickHeadingLink keeps its single `(event)` argument: it is a plain click with no component
data, like a native onClick. The event is now typed React.MouseEvent<HTMLAnchorElement>.
required sets the native attribute and the label asterisk. aria-required
still works and warns once.
ariaLabelledby is deprecated and still works with a warning.
…roup the tooltip props

steps[].assistiveText is { label } (a plain string is deprecated), and
tooltipIsOpenSteps/tooltipPosition move into tooltip.{isOpenSteps,position}.
The old forms still work with a warning.
…label

labels.error accepts a node, errorId is deprecated, and labels.label is the
visible legend (assistiveText.label hides it only when labels.label is unset).
The heading stays an h4 by default.
BREAKING CHANGE: ref now points at the input element instead of the wrapper div.
styleContainer is deprecated in favour of style, and inputRef in favour of ref.
BREAKING CHANGE: the root id is now the id you pass, not id-listbox-of-pill-options.
Update any selector or aria reference that used the old suffixed id.
BREAKING CHANGE: className used to land on the role=progressbar element.
It now lands on the root. Use classNameBar for the progressbar element.
…NameControl

BREAKING CHANGE: className used to land on .slds-form-element__control.
It now lands on the fieldset. Use classNameControl for the control element.
… mode

BREAKING CHANGE: with isCard, id and className now land on the section, not the ol.
…add classNameTable

BREAKING CHANGE: with fixedHeader, className now lands on the outer container div
instead of the table. Use classNameTable for the table element.
@interactivellama
interactivellama force-pushed the feat/v11-p1-5-labels-naming branch 2 times, most recently from e9f3f2b to 7a3c76c Compare November 12, 2026 07:33
interactivellama added a commit that referenced this pull request Nov 16, 2026
The guide was written against the root-and-refs and slots changes
(#3301, closed) that are not in feat/v11-p1-7-typing. Drop the rows and
snippets for them: Badge and MediaObject children, the className* parts
on Combobox, DatePicker, Input, ProgressBar, RadioGroup and
SimpleDataTable, Tooltip className/style, Popover aria-labelledby, and
the other renames that did not land. requestFocus is deprecated, not
removed, on Button, Checkbox and Radio.
interactivellama added a commit that referenced this pull request Nov 18, 2026
The guide was written against the root-and-refs and slots changes
(#3301, closed) that are not in feat/v11-p1-7-typing. Drop the rows and
snippets for them: Badge and MediaObject children, the className* parts
on Combobox, DatePicker, Input, ProgressBar, RadioGroup and
SimpleDataTable, Tooltip className/style, Popover aria-labelledby, and
the other renames that did not land. requestFocus is deprecated, not
removed, on Button, Checkbox and Radio.
interactivellama added a commit that referenced this pull request Nov 19, 2026
The guide was written against the root-and-refs and slots changes
(#3301, closed) that are not in feat/v11-p1-7-typing. Drop the rows and
snippets for them: Badge and MediaObject children, the className* parts
on Combobox, DatePicker, Input, ProgressBar, RadioGroup and
SimpleDataTable, Tooltip className/style, Popover aria-labelledby, and
the other renames that did not land. requestFocus is deprecated, not
removed, on Button, Checkbox and Radio.
interactivellama added a commit that referenced this pull request Nov 20, 2026
Render every export from components/index with minimal props and check
it against the DOM Node & Ref Conventions: `data-*`/`aria-*` props
reach the DOM, `className`, `style` and the forwarded `ref` land on the
outermost element, and a consumer `onClick` runs alongside the
component's own click handling.

A new export without a fixture fails the suite. Components that don't
meet a check yet are listed in `exemptions` with a reason; most are the
ROADMAP P2 additive hardening (`...rest`, `className`, `style`,
`forwardRef`), and the rest are documented placements that would be
breaking to move (root-and-refs, #3301 closed). An exemption that starts
passing fails, so the list can't go stale.
interactivellama added a commit that referenced this pull request Nov 20, 2026
The guide was written against the root-and-refs and slots changes
(#3301, closed) that are not in feat/v11-p1-7-typing. Drop the rows and
snippets for them: Badge and MediaObject children, the className* parts
on Combobox, DatePicker, Input, ProgressBar, RadioGroup and
SimpleDataTable, Tooltip className/style, Popover aria-labelledby, and
the other renames that did not land. requestFocus is deprecated, not
removed, on Button, Checkbox and Radio.
interactivellama added a commit that referenced this pull request Nov 20, 2026
Render every export from components/index with minimal props and check
it against the DOM Node & Ref Conventions: `data-*`/`aria-*` props
reach the DOM, `className`, `style` and the forwarded `ref` land on the
outermost element, and a consumer `onClick` runs alongside the
component's own click handling.

A new export without a fixture fails the suite. Components that don't
meet a check yet are listed in `exemptions` with a reason; most are the
ROADMAP P2 additive hardening (`...rest`, `className`, `style`,
`forwardRef`), and the rest are documented placements that would be
breaking to move (root-and-refs, #3301 closed). An exemption that starts
passing fails, so the list can't go stale.
interactivellama added a commit that referenced this pull request Nov 23, 2026
The guide was written against the root-and-refs and slots changes
(#3301, closed) that are not in feat/v11-p1-7-typing. Drop the rows and
snippets for them: Badge and MediaObject children, the className* parts
on Combobox, DatePicker, Input, ProgressBar, RadioGroup and
SimpleDataTable, Tooltip className/style, Popover aria-labelledby, and
the other renames that did not land. requestFocus is deprecated, not
removed, on Button, Checkbox and Radio.
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