Skip to content

Commit

Permalink
fix: 🐛 dropdown arrow visible when autocomplete disabled
Browse files Browse the repository at this point in the history
When the autocomplete was disabled it also hid the dropdown arrow - this
was caused by `freeSolo={isDisabled}` on the Mui Autocomplete. I
switched that to `disabled={isDisabled`, so now when the component is
disabled the arrow is still visible, but not clickable. This more
closely resembles the disabled behavior of SQFormDropdown.

✅ Closes: #213
  • Loading branch information
Cody Rose committed Apr 15, 2021
1 parent 518d69c commit a73098e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/SQForm/SQFormAsyncAutocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ function SQFormAsyncAutocomplete({
onOpen={onOpen}
onClose={onClose}
inputValue={inputValue}
disabled={isDisabled}
getOptionLabel={option => option.label}
getOptionDisabled={option => option.isDisabled}
renderInput={params => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/SQForm/SQFormAutocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function SQFormAutocomplete({
inputValue={inputValue}
value={initialValue || null}
disableClearable={isDisabled}
freeSolo={isDisabled}
disabled={isDisabled}
getOptionLabel={option => option.label || ''}
getOptionDisabled={option => option.isDisabled}
renderInput={params => {
Expand Down

0 comments on commit a73098e

Please sign in to comment.