Repository navigation
feat!: put className, style and ref on the outermost element - #3268
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
#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]>
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]>
interactivellama
approved these changes
Nov 2, 2026
Niznikr
added a commit
that referenced
this pull request
Nov 4, 2026
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]>
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
Slider, Spinner, Tree, Modal, Popover, WelcomeMat and VerticalNavigation now put
className,styleand the forwardedrefon the outermost element they render. Every other node gets a prop suffixed with its part name (classNameDialog,classNameSpinner,styleList, ...).Before this, each component picked its own target. Popover put
classNameon the dialog andtriggerClassNameon the root. WelcomeMat put it on an inner node. Five of the seven forwarded no ref at all.The rule in
docs/codebase-overview.mdsaidclassNamegoes on "the node carrying.slds-[component]". That conflicts with "the real root" for components that wrap the SLDS node, such as Popover's trigger wrapper and Spinner's container. The rule now says the outermost rendered element. For portal-rendered components, that means the outermost element inside the portal (Modal'ssection.slds-modal), and the portal node getsclassNamePortal.Breaking: two silent moves
These can't warn, because the prop name stays the same:
classNameandstylemove from the.slds-popoverdialog to the root trigger wrapperdiv. To keep styling the dialog, useclassNameDialogandstyleDialog.classNamemoves from.slds-welcome-mat__info-contentto the root.slds-welcome-mat.Deprecated, still working
Each old name is merged with its replacement and logs a one-time development warning through
utilities/warning/deprecated-property.classNameContainerclassNamecontainerClassName,containerStyleclassName,stylelistClassName,listStyleclassNameList,styleListcontainerClassName,contentClassName,contentStyle,footerClassName,headerClassName,portalClassNameclassNameContainer,classNameContent,styleContent,classNameFooter,classNameHeader,classNamePortalcontentsClassName,triggerClassName,footerClassName,footerStyleclassNameDialog,className,classNameFooter,styleFooterRef targets
refpoints at.slds-form-element.slds-spinner_container, or.slds-spinnerwithhasContainer={false}.slds-tree_containersection.slds-modaldiv.slds-welcome-matnav.slds-nav-verticalAlso in this PR
styleFooteralso applies to walkthrough footers, matching what fix(popover): apply classNameFooter to walkthrough footers #3246 did forclassNameFooter..d.tsfiles forutilities/warning/deprecated-propertyandutilities/get-component-doc, so TypeScript components can call them. Popover callsdeprecatedPropertydirectly because itscheck-props.jsisn't wired up.forwardRefitems this PR resolves.fix(modal)commitRoot cause: #3248 removed Modal's
titleandcloseButtonAssistiveText. The #3251 rebase put them back inModalPropsand the destructuring, but nothing reads them, so passing either one type-checked and did nothing. This commit removes them again.It also fixes the progress-indicator modal example. That example passed
title, so no header rendered, and a misspelledfooterClassNames, which never matched a prop.Reviewing
There are three commits.
style:is prettier only.fix(modal):is small.feat!:re-indents whole component bodies because of theforwardRefwrap, so turn on Hide whitespace for that commit.On the touched files, lint warnings go from 50 to 45. That drop isn't a fix: the React-hooks lint rules don't analyze
forwardRefcallbacks, so the same Modal and Tree code is no longer flagged.Tests added:
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.