Repository navigation
feat!: controlled data and selection - #3269
Conversation
Chooses controlled vs uncontrolled by whether the value prop is !== undefined, and only writes internal state when uncontrolled. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…props
Selection and sort are data, so the table renders only what its props say
and reports the requested next state.
- `selection` is required when `selectRows` is set (`SimpleDataTableProps`
is now a union on `selectRows`), and has no `[]` default prop.
- `selection` and `disabledSelection` stay arrays of items but are matched
to `items` by `id` (reference identity only for items without an `id`).
Fresh item objects, e.g. from a store, now match. Previously the row used a
lodash deep partial match, select-all used reference identity and
deselection used a deep match, so the three could disagree.
- The select-all state counts the rows in `items` that are selected, so
selected items that aren't rendered no longer skew it.
- `onRowChange(event, { selection })` is the supported callback. The
deprecated `onChange(selection, event)` still fires and warns once. Both
get the same requested selection, computed from the `selection` prop.
- Row checkboxes and radios always get `checked` and `onChange` (never
`defaultChecked`), disabled rows included; a disabled row never requests
a change.
- Header cells no longer keep an internal `sortDirection` copy that drifted
from the prop. The column renders `sortDirection` only, and `onSort`
reports the requested next direction derived from it.
- Fix a stack overflow when a parent re-rendered the table with unchanged
column children: the column memo deep-compared React elements with
`dequal`, which walked the circular dev-mode `_owner` fiber. Elements are
now compared by type, key and props. Without this, no stateful parent
could update `selection` in development.
BREAKING CHANGE: `selection` is required in the type when `selectRows` is
set, and `SimpleDataTableProps` is a type alias (a union) rather than an
interface, so it can no longer be extended with `interface ... extends`.
Selection and disabled selection are matched by item `id`, not by a deep
partial match of the item. Columns render the `sortDirection` prop only: a
column with `isSorted` but no `sortDirection` no longer toggles its own
direction on click, so pass `sortDirection` and update it in `onSort`.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…lumns
The header cell's class map had a computed `slds-is-sorted_${direction}`
key followed by a literal `slds-is-sorted_asc` key. For an ascending
column the literal key (false) overwrote the computed one, so sorted
ascending columns rendered without `slds-is-sorted_asc`. Story snapshots
for the seven stories with an ascending sorted column gain the class.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Tabs selection is data, so Tabs is now fully controlled. `TabsPanel` takes an optional `value`, `Tabs` takes a required `value` (matched against the panel `value`, or the panel index as a string when it has none) and a required `onSelect`, and there is no internal selection copy. Clicks and arrow keys only report the requested tab through `onSelect`; the stale-copy guard that could fire or skip `onSelect` wrongly in controlled mode is gone, and `onSelect` is no longer called for the already-selected tab or for non-arrow keys. Rendered ids stay index-based. `onSelect` data adds `value` and `previousValue` alongside `selectedIndex` and `previousIndex`. Adds `utilities/warning/required-property` for missing controlled props (`one-of-required-property` only checks the first render per component). ColorPicker keeps its "tab visible when the dialog opens" behavior through a small private stateful wrapper around Tabs. BREAKING CHANGE: `Tabs` `defaultSelectedIndex` is removed (ignored, with a sunset warning); pass `value` and update it in `onSelect`. `value` and `onSelect` are required. Without `value` (or the deprecated `selectedIndex`) no tab is selected and a dev warning is logged. `selectedIndex` still works as a controlled prop when `value` is absent, but is deprecated (warning). Co-Authored-By: Claude Opus 5.5 <[email protected]>
`value` is now required and fully controlled: the summary input and swatch always render it, typing only reports `events.onChange`, and Done reports the working color without writing internal state, so a parent can reject either change. The working color is an internal draft that re-syncs from `value` whenever the popover opens or `value` changes; `valueWorking` is controlled whenever it is not `undefined`. `errorText` is derived from `value` on every render instead of being seeded once. `isOpen` is now honored when set (controlled via `onRequestOpen` / `onRequestClose`), and `defaultIsOpen` seeds the uncontrolled state. BREAKING CHANGE: ColorPicker `value` is required and controlled. Without updating it from `events.onChange` the input no longer accepts typing and Done no longer changes the color; a dev warning fires when `value` is missing. `isOpen` is now honored (previously only seeded); use `defaultIsOpen` for an initial open state. `onRequestOpen` no longer fires when the swatch button closes the popover. Done now fires `onRequestClose` with trigger `submit`. A controlled `valueWorking` now wins over internal edits. `errorText` falls back to built-in validation of the current `value`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`value` is now required, typed `Date | null`, and fully controlled; the
seeded `internalValue` is gone. The typed-text buffer stays internal but
re-syncs whenever `value` changes (by date identity, so an equal
`new Date()` per render does not reset typing, and accepting the typed date
does not reformat it). Clearing the input reports `date: null`.
`isOpen` is controlled whenever it is not `undefined`; `defaultIsOpen` seeds
the uncontrolled state. Open/close from mouse, keyboard and typing all go
through the same request path, and a controlled calendar never opens or
closes itself.
BREAKING CHANGE: DatePicker `value` is required and typed `Date | null`;
the component no longer stores a selected date itself, so update `value`
from `onChange`. `value={undefined}` is treated as `null` and warns.
`formattedValue` is removed (sunset warning; it is ignored). `onChange`
`data.date` can be `null`. Typing now requests close with the new
`input-change` trigger (also when `isOpen` is controlled). Passing
`onRequestOpen` without `isOpen` no longer prevents the calendar from
opening itself. New `defaultIsOpen` prop.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
VerticalNavigation no longer selects the first item when `selectedId` is omitted, and keeps no internal copy of the selection. `selectedId` (`string | null`) and `onSelect` are required; pass `null` for no selection. A dev warning fires when `selectedId` is missing. Also adds type-level regression tests for the controlled Tabs API. BREAKING CHANGE: `selectedId` and `onSelect` are required on VerticalNavigation. Omitting `selectedId` no longer selects the first item; it renders no selection and warns in development. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…andedIds Tree no longer mutates `nodes`. Selection is controlled data, passed as `selectedIds` and reported as `data.selectedIds` in `onSelect`. Expansion is ephemeral UI state: controlled with `expandedIds`, or uncontrolled from `defaultExpandedIds`, and reported as `data.expandedIds` in `onRequestToggle`. Focus and the roving tab stop stay internal, and the tree now has one tab stop: the focused node, else the first visible selected node, else the first node. BREAKING CHANGE: `selectedIds` is required. Tree never writes `selected` or `expanded` on `nodes`, so a consumer that relied on that mutation (for example, arrow keys clearing other selected nodes in a multi-select tree) must apply `data.selectedIds` / `data.expandedIds` instead. A tree without `expandedIds` now expands and collapses on its own. When `selectedIds` (or `expandedIds`/`defaultExpandedIds`) is absent, the deprecated `node.selected` (or `node.expanded`) field is still read, as a read-only fallback, and Tree warns once. Co-Authored-By: Claude Opus 5.5 <[email protected]>
SplitView decides the open-state mode by `isOpen !== undefined` and starts uncontrolled from the new `defaultIsOpen` (default `true`, a documented exception to the boolean-default rule). `events.onToggle` is always called. SplitViewListbox `selection` and `unread` are lists of item ids, and `events.onSelect` reports the requested selection as `data.selection` (alongside `selectedItems` and `item`). The shift-click anchor stays internal. A shift-click range now orders indexes numerically, and starts at the first selected item when nothing was clicked yet. Ctrl+A deselects when every option is selected, not only when `selection === options`. BREAKING CHANGE: SplitViewListbox `selection` and `events.onSelect` are required, and items need an `id`. Passing item objects in `selection` or `unread` is deprecated: they are still matched by `id` (or by identity for items without an `id`) and the listbox warns once. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Popover state now goes through useControllableState. When `isOpen` is
set, the popover never writes internal state. It opens and closes only
when the prop changes. Previously a controlled popover still wrote
internal state, and that state leaked if `isOpen` went back to
undefined.
- `defaultIsOpen` sets the initial state of an uncontrolled popover.
- `onRequestOpen(event, { trigger })` fires on trigger click, or on
hover/focus with `openOn="hover"`, controlled or not. Trigger values
are 'triggerClick', 'mouseEnter' and 'focus'. A disabled popover does
not request open.
- onOpen/onClose/onRequestClose are unchanged.
- Removed the unreachable keyboard open branch. `handleKeyDown` is only
attached to the open dialog.
- The Controlled story and the controlled-with-footer example now open
through `onRequestOpen` instead of the trigger's onClick. This fixes
the example reopening when the trigger was clicked while open.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Tooltip state now goes through useControllableState. A controlled
tooltip (`isOpen` set) never writes internal state: `isOpen={false}`
keeps it closed and `isOpen={true}` keeps it open, whatever the user
does.
- `defaultIsOpen` sets the initial state of an uncontrolled tooltip.
- `onRequestOpen(event, { trigger })` fires on hover (after
`hoverOpenDelay`) or focus, with trigger 'mouseEnter' or 'focus'.
- `onRequestClose(event, { trigger })` fires with trigger 'mouseLeave',
'blur', 'cancel' (Escape) or 'clickOutside'. `event` is undefined for
'clickOutside'.
- Nothing is requested when the dialog unmounts because the tooltip
already closed.
- The trigger/children contract is unchanged.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… state
Whether the section is controlled is now decided by `isOpen !==
undefined`. Passing `onToggleOpen` alone no longer makes it controlled.
`onToggleOpen` is always called, and `data.isOpen` is the requested
(next) state.
`defaultIsOpen` sets the initial state of an uncontrolled section. It
defaults to `true` (sections start open), which is a documented
exception to the boolean-default rule. The InitiallyCollapsed story now
uses `defaultIsOpen={false}`.
BREAKING CHANGE: `onToggleOpen` reports the requested state in
`data.isOpen`, not the current one. Controlled consumers that did
`setIsOpen(!data.isOpen)` should use `setIsOpen(data.isOpen)`. An
uncontrolled section (no `isOpen`) with `onToggleOpen` now toggles
itself; before, the callback froze it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…Open A Step is controlled when `isOpen !== undefined`. `onToggleIsOpen`, including the parent's injected `onStepToggleIsOpen`, is always called with the requested state. An uncontrolled step toggles itself. `defaultIsOpen` sets the initial state of an uncontrolled step. BREAKING CHANGE: a Step without `isOpen` now toggles when `onToggleIsOpen` or SetupAssistant `onStepToggleIsOpen` is set. Before, the callback froze it. Internal state is no longer seeded from `isOpen`. Use `defaultIsOpen` for an uncontrolled initial state. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Panel and autoplay state go through useControllableState. Whether each is controlled is decided by `currentPanel !== undefined` and `isAutoplayOn !== undefined`, not by whether `onRequestPanelChange` or `onRequestAutoplayToggle` is passed. Both callbacks are always called with the requested state. - `defaultCurrentPanel` (default 0) and `defaultIsAutoplayOn` set the uncontrolled initial state. - `hasAutoplay` enables the feature. The start state is `isAutoplayOn ?? defaultIsAutoplayOn`. For back-compat, when neither is set, autoplay starts if `hasAutoplay` is true. - The autoplay interval now reads the latest state on each tick. Before, it captured the starting panel and kept requesting the same next panel. BREAKING CHANGE: passing `onRequestPanelChange` or `onRequestAutoplayToggle` no longer makes the carousel controlled. An uncontrolled carousel with these callbacks now moves and toggles itself. `isAutoplayOn` has no effect without `hasAutoplay`, which also renders the pause button. Before, autoplay ran with no way to pause it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`checked` is now required and is always rendered as `checked={!!checked}`,
so the input never flips between controlled and uncontrolled. `onChange`
reports the requested value (`indeterminate` resolves to checked) and the
DOM `indeterminate` property is restored after the native click clears it,
so `indeterminate` stays controlled by the prop.
Examples that rendered uncontrolled checkboxes (checkbox, button-group,
welcome-mat, progress-indicator) now keep `checked` in state, and the
stories use a stateful wrapper.
BREAKING CHANGE: Checkbox `defaultChecked` is removed. It is ignored and
logs a sunset warning. Pass `checked` and update it in `onChange`.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… value
Radio now requires `checked` and `onChange`, and always renders
`checked={!!checked}`. RadioGroup and RadioButtonGroup take a required
`value: string | null` and derive each child's `checked` from
`child.props.value === value`. `onChange(event, { value, checked })`
reports the selected value (`null` on deselect). Children are typed with
`RadioGroupItemProps`, so they don't need `checked` or `onChange`.
When the group `value` is undefined, the per-Radio `checked` props are
still honored and a one-time deprecation warning is logged.
Consumers updated: radio, radio-group, radio-button-group and
visual-picker examples and stories; color-picker passes `value` to its
RadioButtonGroup; the simple-data-table disabled Radio gets `onChange`.
BREAKING CHANGE: Radio `defaultChecked` is removed. It is ignored and logs
a sunset warning. Radio `checked` and `onChange` are required.
RadioGroup and RadioButtonGroup require `value`. Pass `value` to the group
instead of `checked` on each Radio, and read `data.value` in `onChange`.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
ButtonStateful no longer keeps internal state. It renders from the
required `isActive` prop and calls `onClick(event, { isActive: !isActive })`
with the requested value. Examples and stories keep `isActive` in state.
BREAKING CHANGE: ButtonStateful `active` is renamed to `isActive` and the
internal toggle state is removed. `active` still works as a deprecated
alias and logs a warning. `isActive` wins when both are passed. Pass
`isActive` and update it from `onClick`'s `data.isActive`.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # components/simple-data-table/private/row.tsx
Formatting only, split out so the controlled-value change is reviewable. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Input is now controlled only. `defaultValue` is removed from the type; it is
still accepted at runtime, ignored, and warns once in development.
The counter variant no longer reads or writes the DOM. Increment and
decrement compute the next value from the `value` prop (0 when unset) and
report it through `onChange(event, { number, value })`; the input only
changes when the parent updates `value`. Held-button auto-repeat steps from
the latest `value` instead of a stale closure.
BREAKING CHANGE: `Input` no longer supports `defaultValue`. Pass `value` and
update it from `onChange`. The counter variant no longer updates the input
itself when its buttons are pressed: set `value` from `data.value` (or
`data.number`) in `onChange`.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…alue
`isOpen` is now ephemeral state: when it is undefined the combobox manages
its own open state (seeded by the new `defaultIsOpen`); when it is defined
the parent owns it. This fixes passing only `events.onRequestOpen`, which
used to leave the menu unable to open.
All open and close paths (click, arrow keys, Escape, Enter, blur, select,
click outside, popover Cancel/Done) now go through one request path:
`events.onRequestOpen` / `events.onRequestClose` are called first, and the
state changes only when uncontrolled. `events.onOpen` / `events.onClose`
fire on real transitions, so with a controlled `isOpen` they reflect what
the parent decided rather than the request.
`defaultValue` is removed from the type; it is still accepted at runtime,
ignored, and warns once in development. The action-item `onSelect` data
reads `value` from the prop instead of the DOM.
BREAKING CHANGE: `Combobox` no longer supports `defaultValue`; pass `value`
and update it from `events.onChange`. With a controlled `isOpen`,
`events.onClose` no longer fires when the combobox merely requests a close,
and `events.onRequestClose` now fires for every close path (Escape, blur,
select, Done), not only click-outside and Enter. `events.onRequestOpen` is
called with `(event, {})` and only while closed.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…trolled Checkbox Checkbox no longer keeps an internal copy of checked, so the toggle actions in the examples hold their own state. The hub example binds its substep toggle to the completion state it already tracks; it read event.target.checked without a checked prop and could never un-complete. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Textarea is controlled only. `value` and `onChange` are required in the
type, and `onChange` now receives `(event, { value })`. `defaultValue` is
removed from the type; it is still accepted at runtime, ignored (no longer
passed to the DOM), and warns once in development.
Examples and stories keep their text in state.
BREAKING CHANGE: `Textarea` no longer supports `defaultValue`. `value` and
`onChange` are required; update `value` from `data.value` (or
`event.target.value`) in `onChange`.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Slider is controlled only. `value` is required in the type, and the
displayed value comes only from `value`. `defaultValue` is removed from the
type; it is still accepted at runtime, ignored, and warns once in
development. `onChange(event, { value })` is unchanged.
Examples and stories keep their value in state.
BREAKING CHANGE: `Slider` no longer supports `defaultValue`, and `value` is
required. Update `value` from `data.value` in `onChange`. A slider without
`value` no longer displays `0`.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…isOpen Selection is data: the checkmark/multiple selection now comes only from `value`, derived on every render (including the first), and is no longer toggled internally. `onSelect` data adds `value`, the requested next value (the option's value, or the toggled array when `multiple`). The open state is ephemeral: `isOpen !== undefined` makes it controlled, `defaultIsOpen` seeds the uncontrolled state. New `onRequestOpen` and `onRequestClose(event, data)` are called for every open/close request in both modes. With a controlled `isOpen` no internal state changes; `onOpen` and `onClose` fire when the menu actually opens or closes (with the matching request event when there was one). Opening a menu now asks the previously open one to close through its latest handler. BREAKING CHANGE: MenuDropdown no longer keeps its own selection. Selecting an item does not move the checkmark or toggle a `multiple` item unless the parent updates `value` from `onSelect` (`data.value`); without `value` there is no selection state. A controlled `isOpen` (now any value other than `undefined`) is always honored: clicks, keys, hover and outside clicks call `onRequestOpen`/`onRequestClose` instead of opening or closing the menu, and `onOpen`/`onClose` are no longer called for requests the parent does not apply. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> # Conflicts: # components/button-group/__examples__/icon-group.jsx
…enuDropdown selection The split-view header "Display As" menus passed a static value with an onSelect that only logged, so the checkmark could never move once MenuDropdown derived selection from value. They now keep the value in state. The files actions menu has no checkmark, so its static value only marked the first item selected; it is dropped. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- SimpleDataTable: sorted headers carry slds-is-sorted_asc - Tabs: DefaultSelectedIndex story renamed to InitialValue - MenuDropdown: Controlled story drops the Reset button Co-Authored-By: Claude Opus 5.5 <[email protected]>
Also folds the duplicate Removed heading under Unreleased into one, and corrects the earlier Tabs and DatePicker entries that described the pre-control-model behavior. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ROADMAP: theme 2 gets a Done summary, fully done control-model items are
checked off, and mixed items note what is still open. Adds the tree leaf
`key={generateId()}` remount finding.
codebase-overview: point at useControllableState and the sunset-property
pattern from the control-model rule.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Writing the ref during render tripped react-hooks/refs. A layout effect updates it before any event handler can call the setter, so the setter stays stable and still never writes state while controlled. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
What are the reasons you believe we should we require the callback or make it optional? |
…asc (#3278) * style(simple-data-table): apply prettier to header cell * fix(simple-data-table): flip the sort arrow only with slds-is-sorted_asc Clicking a sorted column's header left the sort arrow pointing down in both directions. Root cause: SLDS draws the sort icon as a down arrow and rotates it 180deg under `slds-is-sorted_asc`. The header cell also swapped the glyph, using `arrowup` for ascending. Before a4be8d0 the `slds-is-sorted_asc` class was never applied, because a duplicate classnames key overwrote it, so the glyph swap was the only flip. Once the class was applied, ascending columns rendered `arrowup` rotated 180deg, which also points down. Always render `arrowdown` and let `slds-is-sorted_asc` turn it, as the SLDS blueprint does. An unsorted column's hover arrow now points down, matching SLDS, instead of up.
I'd require it. Making the value required but the callback optional means a missing handler gives you a control that silently does nothing. React would normally warn about that, but these components attach their own internal handler, so the warning never fires. |
|
Let's proceed with requiring the value change callbacks. |
Conflicts came from #3268 (forwardRef, className on the root), #3266 (Input counter), #3270 (Carousel autoplay) and #3265 (MenuDropdown open registration). - Slider, VerticalNavigation, Popover, Tree: keep master's forwardRef, root className and classNameList/styleList, with the controlled value and selection from this branch. - Input, Carousel, MenuDropdown: keep this branch's implementation, which already fixes the same stale closures through refs. Master's regression tests are kept; the uncontrolled Input maxValue test is rewritten for a controlled counter. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Checkbox, RadioGroup, RadioButtonGroup, ButtonStateful, Slider,
DatePicker, ColorPicker, SimpleDataTable and Tree require their value
prop but left the callback optional. Without the callback the control
renders but can't change, which is a silent bug.
The callback is now required in the props types unless the control is
`disabled: true` (or `readOnly: true` for Checkbox). A literal `true` is
needed to skip it, so `disabled={flag}` still requires the callback.
A missing callback warns once in development through
`utilities/warning/required-property`.
- Checkbox, RadioGroup, RadioButtonGroup, Slider, DatePicker: `onChange`
- ButtonStateful: `onClick`
- ColorPicker: `events.onChange`
- SimpleDataTable: `onRowChange`, only when `selectRows` is set
- Tree: `onSelect`
The deprecated SimpleDataTable `onChange` and Tree `onClick` still fire,
so they satisfy the runtime check but not the types.
BREAKING CHANGE: TypeScript consumers must pass the change callback, or
set `disabled` (or `readOnly` for Checkbox), on these components. Their
props types are now type aliases instead of interfaces, so they can't be
extended with `interface ... extends`.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
When this merges, #2965 should close. |
|
@Niznikr Please resolve conflicts. |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Additional description
What and why. Before GA, every component now follows the control model in ROADMAP.md and docs/codebase-overview.md, so the props don't need another breaking change after 11.0:
checked,value, a date, a selection) is a required prop plus a callback. There is nodefault*twin and no internal copy. The callback reports the requested value, and the component renders whatever the prop says, so a parent can reject a change.value !== undefined, never by whether a callback was passed. Adefault*prop seeds the uncontrolled state, a controlled value is always honored, and the callback always fires. Function components use the newuseControllableStatehook (utilities/hooks/use-controllable-state).Breaking. Every breaking change is listed in the CHANGELOG under Unreleased: two BREAKING entries in Changed (data, then ephemeral state) and one in Removed. Each
feat!commit has aBREAKING CHANGE:footer with the migration. In short:checkedrequired (Radio alsoonChange);defaultCheckedremovedvalue: string | null;onChange(event, { value, checked })active→isActive(required); no internal toggledefaultValueremoved; Slider and Textareavaluerequired; TextareaonChange(event, { value }); Input counter no longer edits the DOMvalue(matched againstTabsPanelvalueor the index as a string) +onSelect;defaultSelectedIndexremovedvalue;onSelectdata gainsvalue;isOpencontrolled when notundefined;defaultIsOpen,onRequestOpen,onRequestCloseselectedId: string | null+onSelect; no first-item defaultselectionrequired withselectRows, matched byid; columns rendersortDirectiononlyselectedIds;expandedIds/defaultExpandedIds; nodes are never mutateddefaultIsOpen; listboxselection/unreadare idsvalue: Date | null;formattedValueremoved;defaultIsOpenvalue;isOpenhonored;defaultIsOpendefault*props; mode keyed off the value prop; callbacks report the requested stateShims. Each removed data prop is stripped before it reaches the DOM, ignored, and logs a dev-only
sunset-propertywarning that names the replacement. Each renamed or reshaped input keeps working and logs a one-timedeprecated-propertywarning:activeselectedIndexcheckedon each Radio inside a groupnode.selected/node.expanded, read-onlyselectionThe new
utilities/warning/required-propertywarns on any render where a required controlled prop is missing.one-of-required-propertyonly checks the first render.Bugs fixed on the way. Each has a regression test:
slds-is-sorted_ascnever rendered. A literalfalsekey overwrote the computed class (separatefix:commit).dequal, which walked React's circular_owner.events.onRequestOpen.isOpenwent back toundefined.selection === options.The stories and examples that relied on uncontrolled mode are now small stateful wrappers. The story snapshot diff has three changes, all in one commit:
slds-is-sorted_asc.DefaultSelectedIndexis renamed toInitialValue.Controlledloses its Reset button, because switching a menu back to uncontrolled isn't supported.For the reviewer to decide or check:
true. ExpandableSection and SplitViewdefaultIsOpendefault totrue, a documented exception to the boolean-default rule, so existing sections and split views still start open.onToggleOpennow reports the requested state, sosetIsOpen(!data.isOpen)code inverts silently. The old pattern can't be detected at runtime. The CHANGELOG spells out the migration.hasAutoplayand noisAutoplayOn/defaultIsAutoplayOn, autoplay still starts. The ROADMAP asked forhasAutoplayto stop meaning "start playing". Should that wait until after the alpha?onOpen/onClosewith a controlledisOpen. They fire when the parent applies the change. The alternative was to never fire them when controlled.SimpleDataTablePropsis now a union type alias. That breaksinterface X extends SimpleDataTableProps.valueis typedstring, with nonull. A missingvalueselects no tab and warns.valuestay optional. Their removeddefaultValuewarns, butvalueisn't required in the type.onRequestClosetriggers. ColorPicker Done reports'submit'; DatePicker typing reports'input-change'.feat(split-view)!rather than a separatefix:commit.key={generateId()}and remount on every render (new ROADMAP item).events.onOpen/onCloseare still unwired.onKeyPresscan fire twice on Space.readOnlyis accepted but unused.Lint. 0 errors. 214 warnings, against 223 on
master: the branch removes 9 and adds none.CONTRIBUTOR checklist (do not remove)
Please complete for every pull request.
Green gate — all of these must pass locally (CI runs the same):
npm run lintpasses with 0 errors (npm run lint:fixto auto-fix). Warnings are the tracked gradual-migration backlog; do not add new errors.npm run typecheckis clean (tsc --noEmit).npm test -- --runpasses — this runs both Vitest projects (jsdomunit+ real-browserbrowser) and the story HTML snapshots. If you changed rendered markup on purpose, update snapshots withnpm test -- --run -uand review the diff.npm run buildsucceeds (type-check + Vite library build +.d.ts+ entry shims).Behavior & docs:
components/button/__tests__). New props and bug fixes should get a regression test. Tests that genuinely need a real browser (focus traversal, layout/measurement, canvas) go in a*.browser.test.jsxfile (thebrowserproject); everything else is jsdom.npm run storybook→ http://localhost:6007/. Confirm the story actually renders and behaves (deprecated Storyshots/Karma are gone; there is no separate browser-tests server).content/visualPickerFigure, render props likerenderItem,iconprops,events), not assumptions — a common source of "component looks broken" reports has been stories authored against the wrong API. Cross-check againstcomponents/<name>/__examples__..d.ts(they're generated by the build); JS consumers rely on them via editor type-acquisition.REVIEWER checklist (do not remove)
CIworkflow: lint, typecheck, test, build). Chromatic visual review, if configured, has been checked.components/__tests__/__snapshots__/story-snapshots.test.jsx.snap).@salesforce/design-system-react/components/<name>and nested paths resolve for ESM, CJS, and types). Removing/renaming a public component or export is a breaking change →feat!:/BREAKING CHANGE:and a major version bump.