Repository navigation
[input base] Fix "Maximum update depth exceeded" error with a start adornment - #49703
Merged
ZeeshanTamboli merged 4 commits intoNov 17, 2026
Merged
Conversation
The effect that calls `muiFormControl.setAdornedStart` re-runs whenever `startAdornment` is a new element, which is the case for inline JSX on every render. Calling it with the same value can still schedule a render of the FormControl when the fiber has pending lanes. React 19 counts such a default-priority update, left pending after a synchronous commit, as a nested update, so fast typing throws "Maximum update depth exceeded". Call `setAdornedStart` only when the value differs from the one in the FormControl context.
Deploy previewhttps://deploy-preview-49703--material-ui.netlify.app/Bundle size
PerformanceNo regressions in 32 benchmarks · ran 4m 02s · details Check out the code infra dashboard for more information about this PR. |
ZeeshanTamboli
approved these changes
Nov 17, 2026
Member
There was a problem hiding this comment.
Thanks! The effect now runs only when the start adornment appears or disappears, so an inline adornment no longer triggers a no-op setAdornedStart on every render. That fixes the "Maximum update depth exceeded" crash with React 19, and unlike the earlier guard, it can't loop when two inputs share one FormControl. Related input tests pass locally. LGTM, and good to cherry-pick to v9.x. I also updated the PR description.
ZeeshanTamboli
enabled auto-merge (squash)
November 17, 2026 09:40
Contributor
|
Cherry-pick PRs will be created targeting branches: v9.x |
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 #49701
InputBasesyncsadornedStartto itsFormControlin an effect that depended on thestartAdornmentelement and the whole context value. An inline adornment is a new element on every render, and in development the context value is also new on every render. So the effect calledsetAdornedStartwith an unchanged value on every render. With React 19, fast re-renders (for example, typing quickly in a large form) pile up these updates until React throws "Maximum update depth exceeded".The effect now depends on
Boolean(startAdornment)and the stablesetAdornedStartsetter, so it runs only when the adornment appears or disappears.