Skip to content

Commit

Permalink
[Autocomplete] Validate freeSolo input (with multiple) (mui-org#18656)
Browse files Browse the repository at this point in the history
  • Loading branch information
picautmarine committed Dec 17, 2019
1 parent 6ced014 commit 7b24238
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ export default function useAutocomplete(props) {
}
};


const handleValue = (event, newValue) => {
if (value === newValue) {
return;
Expand Down Expand Up @@ -639,6 +640,10 @@ export default function useAutocomplete(props) {
const handleInputChange = event => {
const newValue = event.target.value;

if (onInputChange) {
onInputChange(event, newValue, 'input');
}

if (newValue === '') {
if (disableOpenOnFocus) {
handleClose(event);
Expand All @@ -656,10 +661,6 @@ export default function useAutocomplete(props) {
}

setInputValue(newValue);

if (onInputChange) {
onInputChange(event, newValue, 'input');
}
};

const handleOptionMouseOver = event => {
Expand Down

0 comments on commit 7b24238

Please sign in to comment.