[autocomplete] Fix input value and clear by mj12albert · Pull Request #48263 · mui/material-ui (original) (raw)
frewsxcv added a commit to observ-ing/core that referenced this pull request
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
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
@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 deleted the autocomplete/fix-input-value-and-clear-2of5 branch
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 }})