Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/mui-material/src/useAutocomplete/useAutocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ function useAutocomplete(props) {
const isTouchRef = React.useRef(false);

// Calculate the initial inputValue on mount only.
// useRef ensures it doesn't update dynamically with defaultValue or value props.
const initialInputValue = React.useRef(
// Lazy state ensures it doesn't update dynamically with defaultValue or value props.
const [initialInputValue] = React.useState(() =>
getInputValue(defaultValue ?? valueProp, multiple, getOptionLabel),
).current;
);

const [value, setValueState] = useControlled({
controlled: valueProp,
Expand Down
Loading