Repository navigation
fix!: v11 P1 theme 1, behavior and accessibility fixes - #3284
Merged
Merged
Conversation
14 of 15 tasks
Prettier-only reformatting of the alert, combobox, date-picker, docked-composer, page-header, pill, popover and simple-data-table files that the following commits touch, so their diffs show only the fixes.
…in every variant
The button blurred itself on mouse leave (and on blur) after a mouse
click, so focus fell to <body> and the next Tab restarted from the top
of the page. It also called the consumer's onBlur with a MouseEvent.
Stop blurring; focus now behaves like a native button.
With focus kept, SLDS's `.slds-is-selected:focus` rule would show the
hover/focus text ("Unfollow") right after the user chose "Following".
Toggle `slds-is-selected-clicked`, which SLDS provides for this case,
after a mouse click until the button blurs. Keyboard activation keeps
the focus text.
onMouseDown was only wired on the icon variants. Wire it on the text
variants too.
`disabled` only kept the menu closed; the input stayed enabled, so a "disabled" combobox could still be focused and typed into. Only the inline and readonly single-selection inputs could be disabled, through `singleInputDisabled`. `disabled` now disables the input in every variant. `singleInputDisabled` is deprecated as an alias for `disabled` and warns once.
…put prop sets its own The `input` element's props were spread last, so an `onChange` or `inputRef` on it replaced the picker's. The picker then lost track of typed text and of the input node, so closing the calendar could not return focus to the input. Both are now composed: the consumer's runs, then the picker's. Other `input` props still win.
The input's keydown handler called onChange for Enter and Space with a KeyboardEvent cast to a ChangeEvent. Space already toggles a native checkbox through its click, and Enter should not toggle a checkbox, so remove the handler; onChange now only receives real change events. readOnly was accepted but never applied. A read-only checkbox is now announced with aria-readonly, stays focusable, and does not call onChange, so the controlled `checked` does not change. BREAKING CHANGE: Enter no longer toggles a Checkbox, and onChange is no longer called with a KeyboardEvent. readOnly now blocks onChange.
… aria-describedby An open composer behaves like a dialog, so when it mounts open, or the parent opens it without a click, focus the role="dialog" section (now tabIndex=-1). When it unmounts, return focus to the element that had it, if the composer took focus and it has not moved elsewhere. A composer that mounts minimized leaves focus alone. The minimize and expand buttons replace each other, so clicking one unmounted the focused button and focus fell to <body>. When the parent accepts the request, focus now moves to the button that took its place. aria-describedby pointed at the body id while closed, when the body is not rendered. It is now only set while open.
…rendered
With isError, the filter button pointed aria-describedby at
`${id}-error`, which only exists when the Filter sits in a
PanelFilterList with errorLabel. PanelFilterList now provides the id of
the error element it renders through context, and the Filter only sets
aria-describedby when one exists.
The title was skipped with a truthiness check, so `title={0}` rendered
nothing. Only a missing or empty title is skipped now, and boolean
titles are treated as missing, as React does, so
`title={cond && 'Name'}` does not render an empty heading.
A link pill with labels.label renders an <a class="slds-pill__action"> inside a span with role="button", nesting one control in another. The anchor is the control, matching the SLDS blueprint, so the span no longer gets a role. A link pill without a label (content from children) has no anchor and keeps role="button".
The trigger element was cloned with the popover's onFocus, onMouseDown, onMouseEnter and onMouseLeave, replacing any the trigger set itself (or setting them to undefined). They are now merged with mergeProps, so both run. onClick already called the trigger's handler. The trigger tabIndex default uses `??` instead of `||`. -1 already worked (it is truthy); this only makes the intent explicit.
…ses onOpen or onClose The rest props were spread onto Popover after EditDialog's own onOpen, onClose and onRequestClose, so a consumer's handler replaced them and EditDialog's internal open state stopped updating. The consumer's handlers are now called from EditDialog's.
Tooltip and vertical label ids used `step.id || index`, so a step with id 0 got its index instead. They now use `step.id ?? index`. This changes the DOM ids of a step whose id is 0 and is not the first step.
Leaf items were keyed with generateId(), a new key on every render, so every leaf remounted whenever the tree rendered (losing DOM focus and any state). They are now keyed by node.id, like branches.
…ndow resize listener `fixedLayout` no longer adds `slds-table_resizable-cols` (column resizing was removed) or `role="grid"`. The table and its cells get the grid roles only when `keyboardNavigation` is also on, since that is when arrow-key cell navigation runs; a `gridcell` outside a `grid` is invalid ARIA. Fixed headers now follow the scroller and table size through a `ResizeObserver` instead of a `window` resize listener, so they also reposition when the container resizes without the window. The window listener stays as a fallback where `ResizeObserver` is missing. `onFixedHeaderResize` and `onToggleFixedHeaderListeners` existed only to replace that listener. They are deprecated with a warning and still called until GA.
An item without `url` rendered `<a href="#">` and cancelled the click, so screen readers announced a link that goes nowhere and middle-click opened the page in a new tab. It now renders `<button type="button" class="slds-button_reset slds-nav-vertical__action">`, which keeps the SLDS look (checked in a browser test against the real stylesheet) and is operable with Enter and Space. `NavigationItem.url` is optional to match. BREAKING CHANGE: `onSelect` receives `MouseEvent<HTMLAnchorElement | HTMLButtonElement>`; handlers that annotate the event as an anchor event must widen the type. Styles or selectors that target `a.slds-nav-vertical__action` need to match the button for items without `url`.
Without `href` the link rendered an `<a>` with no `href`, which is not focusable and has no link role. `href` is now required in the type and a missing one warns once at runtime through a new `check-props.js`. BREAKING CHANGE: `VisualPickerLink` requires `href`. Pass the link target; an option that is not a link belongs in a `Checkbox` or `Radio` visual picker instead.
`InfoBadge` always rendered the check icon, so screen readers announced "Completed" on a badge that was not, and SLDS 1 hid it with CSS only inside a complete progress block. The icon now renders only when `isComplete` is set (the WelcomeMat sets it from its tiles). The badge `<img>` keeps `alt=""` by default; the new `assistiveText.image` gives it alt text when the image carries meaning.
interactivellama
force-pushed
the
feat/v11-p1-1-behavior-fixes
branch
from
November 10, 2026 07:27
91e8f60 to
34a128d
Compare
interactivellama
marked this pull request as ready for review
November 10, 2026 08:00
Niznikr
approved these changes
Nov 10, 2026
12 of 15 tasks
This was referenced Nov 20, 2026
interactivellama
added a commit
that referenced
this pull request
Nov 20, 2026
Make @typescript-eslint/consistent-type-assertions an error in components/ and utilities/ source. Casts hid real bugs during the v11 migration: a ReactNode summary cast to string rendered an "[object Object]" tooltip in AccordionPanel (#3253), and Checkbox called onChange with a KeyboardEvent cast to a ChangeEvent (#3284). Use assertionStyle 'never'. It still allows `as const`, which only narrows a literal and cannot hide a mismatch, so 'never' is workable here. Allowing object-literal assertions was not needed: `{} as T` is the shape that lets a partial object pass as a complete one, and annotations or `satisfies` cover the legitimate uses. The 404 casts that predate the rule (110 files) are recorded in eslint-suppressions.json with `--suppress-rule`, the mechanism the no-deprecated rule uses. Pruning them is a GA item on the roadmap. Tests, examples and stories are exempt.
interactivellama
added a commit
that referenced
this pull request
Nov 20, 2026
…an be Radio calls onChange with the input's `change` event when a click selects it, but with the `click` event when a click deselects a checked `deselectable` radio (a checked radio fires no `change`), and with the `keydown` event for Enter, and for Space on a checked `deselectable` radio. Radio cast the click to a ChangeEvent, and RadioGroup cast Radio's ChangeEvent | KeyboardEvent to a ChangeEvent, so RadioGroup and RadioButtonGroup's `onChange` was typed as always getting a ChangeEvent. This is the same mismatch as Checkbox's KeyboardEvent cast to a ChangeEvent (#3284). The events themselves predate v11: 0.10.x passed the click and keypress events too, but it had no types. Unlike Checkbox, these keyboard and click paths are real behavior (deselecting, and Enter to select), so the fix is the type, not the handler. Add RadioChangeEvent (ChangeEvent | MouseEvent | KeyboardEvent on the input) and use it for Radio's and RadioGroup's onChange, and drop both casts. ColorPicker's swatch toggle was the one internal handler typed for a ChangeEvent only; it now reads `data.value`. BREAKING CHANGE: RadioGroup and RadioButtonGroup's `onChange` event is typed as `RadioChangeEvent`, and Radio's adds MouseEvent. A handler whose event parameter is annotated as `ChangeEvent` no longer type-checks; read the selection from `data.value`.
interactivellama
added a commit
that referenced
this pull request
Nov 20, 2026
…n the menu When Enter, Space, Up or Down on the trigger opens the menu, keyboardNavigate calls the context's handleClick with that keydown event, and MenuDropdown passed it to `onClick` cast `as unknown as MouseEvent`. So `onClick` was typed as always getting a MouseEvent, and a handler reading `clientX` or `button` type-checked and got `undefined` from the keyboard. This is the same KeyboardEvent-as-another-event cast as Checkbox's (#3284). 0.10.x also called onClick with the keypress event, but had no types. Type `onClick`'s event as `MouseEvent | KeyboardEvent`, and build the keyboard context where the keydown event is in scope, so handleClick passes it through without a cast. BREAKING CHANGE: MenuDropdown's `onClick` event is typed as `MouseEvent | KeyboardEvent`. A handler whose event parameter is annotated as `MouseEvent` no longer type-checks.
interactivellama
added a commit
that referenced
this pull request
Nov 20, 2026
Make @typescript-eslint/consistent-type-assertions an error in components/ and utilities/ source. Casts hid real bugs during the v11 migration: a ReactNode summary cast to string rendered an "[object Object]" tooltip in AccordionPanel (#3253), and Checkbox called onChange with a KeyboardEvent cast to a ChangeEvent (#3284). Use assertionStyle 'never'. It still allows `as const`, which only narrows a literal and cannot hide a mismatch, so 'never' is workable here. Allowing object-literal assertions was not needed: `{} as T` is the shape that lets a partial object pass as a complete one, and annotations or `satisfies` cover the legitimate uses. The 404 casts that predate the rule (110 files) are recorded in eslint-suppressions.json with `--suppress-rule`, the mechanism the no-deprecated rule uses. Pruning them is a GA item on the roadmap. Tests, examples and stories are exempt.
interactivellama
added a commit
that referenced
this pull request
Nov 24, 2026
…an be Radio calls onChange with the input's `change` event when a click selects it, but with the `click` event when a click deselects a checked `deselectable` radio (a checked radio fires no `change`), and with the `keydown` event for Enter, and for Space on a checked `deselectable` radio. Radio cast the click to a ChangeEvent, and RadioGroup cast Radio's ChangeEvent | KeyboardEvent to a ChangeEvent, so RadioGroup and RadioButtonGroup's `onChange` was typed as always getting a ChangeEvent. This is the same mismatch as Checkbox's KeyboardEvent cast to a ChangeEvent (#3284). The events themselves predate v11: 0.10.x passed the click and keypress events too, but it had no types. Unlike Checkbox, these keyboard and click paths are real behavior (deselecting, and Enter to select), so the fix is the type, not the handler. Add RadioChangeEvent (ChangeEvent | MouseEvent | KeyboardEvent on the input) and use it for Radio's and RadioGroup's onChange, and drop both casts. ColorPicker's swatch toggle was the one internal handler typed for a ChangeEvent only; it now reads `data.value`. BREAKING CHANGE: RadioGroup and RadioButtonGroup's `onChange` event is typed as `RadioChangeEvent`, and Radio's adds MouseEvent. A handler whose event parameter is annotated as `ChangeEvent` no longer type-checks; read the selection from `data.value`.
interactivellama
added a commit
that referenced
this pull request
Nov 24, 2026
…n the menu When Enter, Space, Up or Down on the trigger opens the menu, keyboardNavigate calls the context's handleClick with that keydown event, and MenuDropdown passed it to `onClick` cast `as unknown as MouseEvent`. So `onClick` was typed as always getting a MouseEvent, and a handler reading `clientX` or `button` type-checked and got `undefined` from the keyboard. This is the same KeyboardEvent-as-another-event cast as Checkbox's (#3284). 0.10.x also called onClick with the keypress event, but had no types. Type `onClick`'s event as `MouseEvent | KeyboardEvent`, and build the keyboard context where the keydown event is in scope, so handleClick passes it through without a cast. BREAKING CHANGE: MenuDropdown's `onClick` event is typed as `MouseEvent | KeyboardEvent`. A handler whose event parameter is annotated as `MouseEvent` no longer type-checks.
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 1 "behavior-fixes" items in the ROADMAP.md P1 prop API freeze review.
Additional description
Runtime and accessibility fixes that keep the current API. This is the bottom of an 8-PR stack (behavior-fixes, removals, callbacks, slots, labels-naming, root-and-refs, typing, data-models), ordered from the smallest break to the largest. It targets
master.Stack after the 2026-11-08 scope cut. The themes were re-ranked by how much they help someone (or an agent) write correct code against the published types: wrong code fails
tsc, one pattern holds across components, and nothing compiles but silently misbehaves. Themes 1 and 2 keep their full scope. Themes 3–8 were trimmed before pushing:(event, data)changes; the additive renames (date-pickerisValid, icon-settingsgetIconPath, modaldisableCloseOnClickOutside, edit-dialogonRequestOpen, tooltipgetTargetElement) are deferred past GA.aria-labelledby,required). English-default moves intolabelsare deferred; theselectionMode,autoCloseDelayanderrorIconrenames and tooltip's default-content removal are cut.classNamenarrowing and two naming-only changes.isDisabled, docked-composerdefaultIsOpen); the additive ones are deferred and the menu-list alias removal is cut.Deferred work stays on tags and can land in an 11.x minor.
The first commit is a single
style:commit with all the prettier-only reformatting; after that there is onefixcommit per component, so it can be reviewed commit by commit. Alert is unchanged: it still focuses its close button on mount.onMouseDownis called in the text variants; the selected text shows after a mouse clickdisabledreaches the input in every variant;singleInputDisabledis deprecatedinputprop with its ownonChange/inputRefno longer replaces the picker's (which broke typing and focus on close)onChangenever gets aKeyboardEvent;readOnlyis applied (aria-readonly, focusable, no toggle)aria-describedbyonly while openaria-describedbyonly points at an error element that is renderedtitleof0renders; a boolean title renders nothing<a>is no longer wrapped inrole="button"onOpen/onClose/onRequestCloseno longer replaces the dialog's own state handlingidof0is used in DOM idsfixedLayoutdrops the vestigial grid markup;ResizeObserverreplaces thewindowresize listener; the two fixed-header listener callbacks are deprecatedurlrender a<button>, andurlis optionalVisualPickerLinkrequireshref(warns once when missing)assistiveText.imageDecisions
singleInputDisabledbecomes a deprecated alias fordisabled, to be removed at GA.onChange/inputRefare composed with the consumer's (consumer first); otherinputprops keep "consumer wins".role="dialog"(SLDS); focus the dialog when it opens without a click, but not when it mounts minimized.onToggleFixedHeaderListeners/onFixedHeaderResizeare deprecated viasunset-propertyand still called until GA.<button>instead of<a role="button">for items withouturl.hrefis required in the type, with arequired-propertyruntime warning.Breaking changes and migration (CHANGELOG has the details):
onKeyDown.onSelectevent annotations toHTMLAnchorElement | HTMLButtonElement, and update selectors that targeta.slds-nav-vertical__action.href, or use a Checkbox or Radio visual picker for options that don't navigate.TinyNod (pre-push, advisory):
findings, 5 total, none fixed. The one warning (pill/index.tsx:258, "no null guard on return value") is a false positive: that line is aclassNameattribute. The 4 info findings (bundle size, naming) are generic and not actionable.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.