[autocomplete] Guard against null inputRef during unmount by noam3127 · Pull Request #48617 · mui/material-ui (original) (raw)
Fixes a React 19 regression where inputRef.current is null when syncHighlightedIndexToDOM runs during unmount, causing Cannot read properties of null (reading 'removeAttribute'). React 19 cleans up refs before pending callbacks fire. Adds a null guard matching the existing listboxRef.current pattern. Originally fixed in #25311 but lost in the v9 rewrite.
- I have followed (at least) the PR section of the contributing guide.