Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
captain-yossarian committed Feb 2, 2020
1 parent e530032 commit a041157
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions docs/src/pages/components/autocomplete/Tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ export default function Tags() {
options={top100Films.map(option => option.title)}
defaultValue={[top100Films[13].title]}
freeSolo
autoHighlight
autoSelect
renderTags={(value, getTagProps) =>
value.map((option, index) => (
<Chip variant="outlined" label={option} {...getTagProps({ index })} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ export default function useAutocomplete(props) {
}
const isEmptyOptions = filteredOptions.length === 0;

if (freeSolo && popupOpen) {
if (autoSelect) {
if (!isEmptyOptions && highlightedIndexRef.current !== -1 && multiple) {
selectNewValue(event, filteredOptions[highlightedIndexRef.current], 'freeSolo');
}
Expand Down

0 comments on commit a041157

Please sign in to comment.