Repository navigation
fix: replace deprecated DOM and React APIs - #3327
Merged
Merged
Conversation
interactivellama
force-pushed
the
fix/deprecated-dom-apis
branch
from
November 17, 2026 02:47
a8b5de1 to
fd7a95e
Compare
6 of 15 tasks
interactivellama
force-pushed
the
fix/deprecated-dom-apis
branch
from
November 17, 2026 17:47
db96e5f to
9cc3f86
Compare
interactivellama
force-pushed
the
fix/deprecated-dom-apis
branch
from
November 17, 2026 21:54
9cc3f86 to
7dc1818
Compare
interactivellama
force-pushed
the
fix/deprecated-dom-apis
branch
from
November 17, 2026 22:45
7dc1818 to
8dab297
Compare
interactivellama
force-pushed
the
fix/deprecated-dom-apis
branch
from
November 18, 2026 23:06
8dab297 to
3a57ae2
Compare
interactivellama
force-pushed
the
fix/deprecated-dom-apis
branch
from
November 19, 2026 04:41
3a57ae2 to
95518da
Compare
interactivellama
force-pushed
the
fix/deprecated-dom-apis
branch
from
November 19, 2026 22:07
95518da to
e0b73be
Compare
interactivellama
force-pushed
the
fix/deprecated-dom-apis
branch
from
November 20, 2026 00:14
e0b73be to
0da3b27
Compare
interactivellama
force-pushed
the
fix/deprecated-dom-apis
branch
4 times, most recently
from
November 20, 2026 23:51
9200d09 to
36084ff
Compare
substr takes a length and slice takes an end index, so the second argument is converted at each call. A combobox test pins the highlighted search term.
keypress is a deprecated DOM event. Button, ButtonStateful, Checkbox, Input and Textarea still forward onKeyPress during the 11.x RC, mark it @deprecated and warn; 11.0 removes it.
React 19 deprecates FormEvent and MutableRefObject. Input, Textarea and Slider type onInput, onSubmit, onInvalid and onSelect with InputEvent, SubmitEvent and SyntheticEvent, matching React's DOM handler types; ref casts use RefObject.
…a calendar day The shift branch checked keyDownCallbacks but called shiftKeyDownCallbacks, which only maps Tab, so any other mapped key held with shift threw a TypeError.
interactivellama
force-pushed
the
fix/deprecated-dom-apis
branch
from
November 21, 2026 00:04
36084ff to
8f25ca6
Compare
4 of 15 tasks
interactivellama
marked this pull request as ready for review
November 21, 2026 00:32
Niznikr
approved these changes
Nov 24, 2026
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.
Part of the v11 merge train, stack 1 "clean CI": ci-warnings → react-hooks-refs → deprecated-dom-apis → deprecated-prop lint (#3311) → rc.1 release (#3342). Private exports shipped in rc.0.
Additional description
This replaces deprecated DOM and React APIs, so the next PR (#3311) can make
@typescript-eslint/no-deprecatedan error.KeyboardEvent.keychange (fix!, with the Radio keypress fix) shipped in 11.0.0-rc.0 via feat!: v11 RC breaking changes (key values, package exports) #3333, so this PR no longer carries it and is not breaking.substr→slice.substrtakes a length andslicean end index, so each call's second argument is converted. A Combobox test pins the highlighted search term (it fails if a conversion is wrong).feat: deprecateonKeyPresson Button, ButtonStateful, Checkbox, Input and Textarea. They still forward it during the 11.x RC, mark it@deprecatedpointing toonKeyDown, and log a deprecation warning; 11.0 removes it. One test file covers all five.onInput,onSubmit,onInvalidandonSelectwithInputEvent,SubmitEventandSyntheticEventinstead of the deprecatedFormEvent;MutableRefObjectcasts becomeRefObject.fix(date-picker): Shift plus a mapped key no longer throws on a calendar day. Root cause: the Shift branch inprivate/day.tsxcheckedkeyDownCallbacks[event.key]but calledshiftKeyDownCallbacks[event.key](), which only maps Tab, so Shift+Arrow, Shift+Space and Shift+Enter threwTypeError: ... is not a function. Shift+Tab was unaffected. The branch now checks the Shift map, so those keys fall through to their unshifted handlers. The bug predates this PR (it was there withkeyCode); code review found it because this PR rewrote that block. Regression test: "navigates to previous day with shift held".Commits
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.