Repository navigation
feat!: v11 P1 theme 3, callback shapes and ref-based focus - #3295
Merged
Merged
Conversation
interactivellama
force-pushed
the
feat/v11-p1-3-callbacks
branch
2 times, most recently
from
November 11, 2026 07:49
e49d76f to
c980433
Compare
interactivellama
marked this pull request as ready for review
November 11, 2026 08:05
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()`.
interactivellama
force-pushed
the
feat/v11-p1-3-callbacks
branch
from
November 11, 2026 08:25
c980433 to
aef13a7
Compare
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>.
interactivellama
force-pushed
the
feat/v11-p1-3-callbacks
branch
from
November 11, 2026 09:00
aef13a7 to
926ea3b
Compare
interactivellama
force-pushed
the
feat/v11-p1-3-callbacks
branch
from
November 11, 2026 09:10
926ea3b to
b74c415
Compare
Niznikr
approved these changes
Nov 11, 2026
7 of 17 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the theme 3 "callbacks" items in the ROADMAP.md P1 prop API freeze review.
Based on
master. Themes 1 (#3284) and 2 (#3285) have merged, so this branch was rebased ontomasterand the diff shows only theme 3. Theme 4 (slots) stacks on this branch.Additional description
Callback cleanup for the v11 prop freeze. Callbacks follow
(event, data), consumereventsobjects are read without rebuilding handlers, and the non-nativerequestFocus/onRequestFocusfocus API is removed in favor of refs. One commit per component, with format-only changes in separatestyle:commits.requestFocus/onRequestFocusdeprecated (still work, warn once). Focus throughref/buttonRef.SimpleDataTableInteractiveElementnow focusesforwardRefchildren (Button, Checkbox, the internal link) throughref; other wrapped components still get the documented propsonRequestPanelChange/onRequestAutoplayToggle(never{}or stale)useLatestRef(utilities/hooks). It updates in an insertion effect, so handlers called from a child's layout effect see the latest callbacksevents.onOpen/onClose/onRequestOpen/onRequestCloseare wired (they were typed but never called); the top-level props are deprecated.validateColor/validateWorkingColorreplaceevents.onValidate*(deprecated).onRequestClosefires before the state change, with a typedColorPickerRequestCloseTriggereventsis read throughuseLatestRef, so the internal handlers are stablefix)requestFocus/onRequestFocusdeprecated (still work, warn once). Focus throughrefrequestFocus/onRequestFocusdeprecated (still work, warn once). Focus throughrefs.inputonSort(event, { property, sortDirection })(was(data, event)) and RowActionsonAction(event, { item, option })(was(item, option)).onLoadMoregets(event, { trigger }). AddsSimpleDataTableLoadMoreDataandSimpleDataTableRowActionData. The deprecatedonFixedHeaderResizegetsundefined, notnull, without an event. Taken from the closed #3280onCalendarFocusgetsundefined, notnull, aseventwhen a month change moves focus. Keyboard moves still pass the keydown eventonClickHeadingLinkkeeps a single(event)argument, typedMouseEvent<HTMLAnchorElement>Decisions
requestFocus/onRequestFocusare deprecated, not removed: v0.10.65 documents them with no deprecation, and v11 only removes props deprecated in 0.10.x.sunset-property. A renamed prop keeps working and warns once throughdeprecated-property.undefined: callbacks with no DOM event passundefined, notnull(onLoadMore,onFixedHeaderResize,onCalendarFocus).get*/validate*names, matching date-picker'sparser/formatter(color-pickervalidateColor/validateWorkingColor).eventskey and the deprecated top-level prop are set, both are called. Uncontrolled, the picker still closes itself; withisOpenpassed, the parent decides.onRequestOpen's(event, data)shape is deferred past GA (additive).datais deferred past GA (additive).refto the<input>belongs to theme 6.onChangethat feat!: move the remaining callbacks to (event, data) #3280 also touched was already removed on master.dataargument, like a nativeonClick. Alert'sonClickHeadingLinkfollows the same rule.isValid/source, icon-settingsgetIconPath, modaldisableCloseOnClickOutside, edit-dialoghandleOpen→onRequestOpen, tooltip/popovergetTargetElement, and the rest of the closed feat!: move the remaining callbacks to (event, data) #3280's typed callbackdata(alert, color-pickeronRequestOpen, docked-composer, input/search, pill, filteronClick, edit-dialogonCancel/onSave, split-view listboxonSort, accordion, panel, combobox). They are recorded in ROADMAP.md.Breaking: simple-data-table and date-picker. CHANGELOG has BREAKING entries with the migrations (swap the
onSort/onActionarguments; check!eventrather thanevent === nullinonCalendarFocus).TinyNod (pre-push, advisory):
findings, 2 info, none fixed. Both are false positives. The bundle-size note is about a test file, which is not shipped, and the CHANGELOG naming note is generic, with no rule to act on.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.