Repository navigation
feat!: standardize v11 callback shapes on (event, data) - #3251
Merged
Merged
Conversation
Callbacks across Tabs, MenuDropdown, Carousel, SetupAssistant, Popover,
Tree, SplitView, PillContainer, Toast, Modal, WelcomeMat and DatePicker
now receive (event, data), report the requested state in data, and have
exported data types. Old Tree, SplitView and PillContainer callbacks are
deprecated with one-time warnings rather than removed.
BREAKING CHANGE: Tabs onSelect is called as onSelect(event, { selectedIndex,
previousIndex }) and returning false no longer cancels the selection.
MenuDropdown onSelect is called as onSelect(event, { option, optionIndex }).
Carousel onRequestAutoplayToggle and SetupAssistant onStepToggleIsOpen /
SetupAssistantStep onToggleIsOpen data report the requested state. Popover
onRequestClose data always includes a trigger. See CHANGELOG.md.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
interactivellama
force-pushed
the
feat/callback-shapes
branch
from
October 27, 2026 07:57
4a44a88 to
a78b8b3
Compare
…base #3248 removed Modal's check-props module and its checkProps call; the callback-shapes rebase reintroduced the import and the componentDoc import. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
interactivellama
approved these changes
Oct 27, 2026
14 of 15 tasks
interactivellama
added a commit
that referenced
this pull request
Oct 29, 2026
* feat!: standardize v11 callback shapes on (event, data)
Callbacks across Tabs, MenuDropdown, Carousel, SetupAssistant, Popover,
Tree, SplitView, PillContainer, Toast, Modal, WelcomeMat and DatePicker
now receive (event, data), report the requested state in data, and have
exported data types. Old Tree, SplitView and PillContainer callbacks are
deprecated with one-time warnings rather than removed.
BREAKING CHANGE: Tabs onSelect is called as onSelect(event, { selectedIndex,
previousIndex }) and returning false no longer cancels the selection.
MenuDropdown onSelect is called as onSelect(event, { option, optionIndex }).
Carousel onRequestAutoplayToggle and SetupAssistant onStepToggleIsOpen /
SetupAssistantStep onToggleIsOpen data report the requested state. Popover
onRequestClose data always includes a trigger. See CHANGELOG.md.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* fix(modal): drop check-props and component.json leftovers from the rebase
#3248 removed Modal's check-props module and its checkProps call; the
callback-shapes rebase reintroduced the import and the componentDoc import.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Stephen James <[email protected]>
12 of 15 tasks
interactivellama
pushed a commit
that referenced
this pull request
Nov 2, 2026
* style: format components touched by the className/root change Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(modal): drop dead title and closeButtonAssistiveText props #3248 removed both props, and the callback-shapes rebase in #3251 reintroduced them in ModalProps and the destructuring. Nothing reads them, so passing either one did nothing. The progress-indicator modal example passed `title` (so no header rendered) and `footerClassNames`, which never matched a prop. Use `heading` and `footerClassName`. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat!: put className, style and ref on the outermost element Slider, Spinner, Tree, Modal, Popover, WelcomeMat and VerticalNavigation now forward `ref` to the outermost element they render, which is also where `className` and `style` land. Other nodes take suffixed props (`classNameDialog`, `classNameSpinner`, `classNameList`, `styleFooter`, ...). Props named the old way (`containerClassName`, `listStyle`, `footerClassName`, `triggerClassName`, ...) still work, are merged with their replacements, and log a one-time development warning. Popover's `styleFooter` applies to walkthrough footers too, like `classNameFooter`. The docs rule in codebase-overview.md now says the outermost rendered element, not the `.slds-[component]` node. BREAKING CHANGE: Popover `className` and `style` apply to the root trigger wrapper instead of the `.slds-popover` dialog; use `classNameDialog` and `styleDialog` for the dialog. WelcomeMat `className` applies to `.slds-welcome-mat` instead of `.slds-welcome-mat__info-content`. See CHANGELOG.md. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This was referenced Nov 5, 2026
interactivellama
added a commit
that referenced
this pull request
Nov 11, 2026
…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.
interactivellama
added a commit
that referenced
this pull request
Nov 11, 2026
…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.
8 of 15 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.
Additional description
Callbacks across 12 components now share one shape, as the callback conventions require:
(event, data).eventis the React event that caused the call, orundefinedwhen there is none (a timer, an unmount, a programmatic change).datais always an object, with an exported type.onRequest*and toggle callbacks report the requested state, not the current one.Where the roadmap keeps a callback's name, the signature changes in place (breaking). Where it renames one, the old prop keeps working with its old payload and logs a one-time deprecation warning.
Breaking changes and migration
TabsonSelect(selectedIndex, lastIndex); returningfalsecancelled the selectiononSelect(event, { selectedIndex, previousIndex }); the return value is ignoreddata. To block a tab change, control the component: passselectedIndexand update it only when the change should happenMenuDropdownonSelect(option, { option, optionIndex })onSelect(event, { option, optionIndex })(option) => …to(event, { option }) => …. Handlers that read the second argument need no changeMenuDropdownList) content calledonSelectwith an empty option andoptionIndex: -1onSelectis not calledonCloseto react to those clicksCarouselonRequestAutoplayToggledataisAutoplayOnwas the current statesetIsAutoplayOn(!data.isAutoplayOn)becomessetIsAutoplayOn(data.isAutoplayOn)Carousel{}as the eventundefinedevent?.SetupAssistant/SetupAssistantSteponStepToggleIsOpen/onToggleIsOpendataisOpenwas the current stateexpanded[i] = !data.isOpenbecomesexpanded[i] = data.isOpenPopoveronRequestClosedata was sometimes{}trigger:'cancel' | 'clickOutside' | 'mouseLeave' | 'newPopover' | 'triggerClick'undefinedCarouselonRenderItemis now typed as({ item }) => ReactElement, which is how it has always been called at runtime.Deprecated (still work, warn once)
Tree:onClickis replaced byonSelect(event, { node, isSelected }).onExpandClickis replaced byonRequestToggle(event, { node, isExpanded }).onRequestTogglefires only for real expand/collapse requests. Left arrow on an item or a collapsed branch now selects the parent throughonSelectand leaves it expanded, as the WAI-ARIA tree pattern describes. Before, it came throughonExpandClickwithselect: trueand usually collapsed the parent.onExpandClickkeeps the old behaviour.onScrolldata gainsratio(0–1).percentageis deprecated.SplitView:events.onOpenandevents.onCloseare replaced byevents.onToggle(event, { isOpen }).PillContainer: the flatonClickPillandonRequestRemovePillprops move into aneventsobject, with the same signatures.In every case the new callback wins if both are passed.
Non-breaking: callbacks that took no arguments now get
(event, data)ToastonRequestClose(event, { trigger: 'close-button' | 'timeout' }). The timer path passesundefinedas the event.ModalandWelcomeMatonRequestClose(event, { trigger: 'close-button' | 'escape' | 'click-outside' }).DatePicker:onRequestOpen(event, { trigger })andonRequestClose(event, { trigger }). For an outside click the event is the nativemousedown/touchstart, because the listener is ondocument.onClose(undefined, { componentWillUnmount }).MenuDropdownonOpen(event, {})andonClose(event, {}).Bug fixes (with regression tests)
Toastnever auto-dismissed while its parent kept re-rendering with an inlineonRequestClose.onRequestClose, so every new function cleared and restarted the timeout.Popover: opening a second popover never closed the first.handleClosecaptured while the popover was still closed, so itsisOpenguard always made it a no-op.MenuDropdownonClosefired twice per close.MenuDropdown: mouse selection passed no event.DatePickeronRequestClosefired when the calendar was already closed.DatePickerkeyboard open/close skippedonRequestOpen/onRequestClose.TreeonScrollreportedNaN/Infinityfor a list that can't scroll.ratiois computed fromcurrentTargetand clamped.Not in this PR
default*props, how controlled vs uncontrolled mode is detected), child contracts, and other renames belong to separate roadmap themes.selectedValue/previousValuefor Tabs. Tabs has no value prop today, so this PR uses index names.'clickOutside'can't currently fire.(event, { trigger })to a consumer'spopover.props.onClose.onSelectfor any key pressed on a tab.Testing
(event, data)payloads, including the requested-state values, theundefinedevents on timer and unmount paths, and the deprecated paths and their warnings.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).onRenderContent/onRenderVisualPicker,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.