[autocomplete] Fix input value and clear by mj12albert · Pull Request #48263 · mui/material-ui (original) (raw)

@mj12albert

silviuaavram

@mj12albert

frewsxcv added a commit to observ-ing/core that referenced this pull request

May 19, 2026

@frewsxcv

9.0.1 ships a useAutocomplete change (mui/material-ui#48263) that clears the input in freeSolo/null-value scenarios. Our TaxaAutocomplete hits that path, which broke tests/observation-edit.spec.ts "edit modal pre-populates species".

frewsxcv added a commit to observ-ing/core that referenced this pull request

May 19, 2026

@frewsxcv

Isolates the suspected breakage from the larger PR #477 dep bundle. 9.0.1 ships mui/material-ui#48263 (resetInputValue change for freeSolo+null value); the goal here is to reproduce the observation-edit "pre-populates species" test failure and try fixes.

frewsxcv added a commit to observ-ing/core that referenced this pull request

May 19, 2026

@frewsxcv

@mui/material 9.0.1 (mui/material-ui#48263) made useAutocomplete's resetInputValue clear a non-empty inputValue when value is null and freeSolo is set. Our inputValue was controlled but value was not, so an async setSpecies("Quercus alba") in UploadModal's edit-mode useEffect was wiped before the user saw it.

Controlling value alongside inputValue flips isOptionSelected to true, so the reset path short-circuits.

@mj12albert mj12albert deleted the autocomplete/fix-input-value-and-clear-2of5 branch

June 3, 2026 14:28

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

[ Show hidden characters]({{ revealButtonHref }})