From a73098e4257196293192ba17de51603c393b33df Mon Sep 17 00:00:00 2001 From: Cody Rose Date: Wed, 14 Apr 2021 22:19:52 -0500 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20dropdown=20arrow=20visibl?= =?UTF-8?q?e=20when=20autocomplete=20disabled?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/components/SQForm/SQFormAsyncAutocomplete.js | 1 + src/components/SQForm/SQFormAutocomplete.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/SQForm/SQFormAsyncAutocomplete.js b/src/components/SQForm/SQFormAsyncAutocomplete.js index b6dd38bb..9a4f01ff 100644 --- a/src/components/SQForm/SQFormAsyncAutocomplete.js +++ b/src/components/SQForm/SQFormAsyncAutocomplete.js @@ -165,6 +165,7 @@ function SQFormAsyncAutocomplete({ onOpen={onOpen} onClose={onClose} inputValue={inputValue} + disabled={isDisabled} getOptionLabel={option => option.label} getOptionDisabled={option => option.isDisabled} renderInput={params => { diff --git a/src/components/SQForm/SQFormAutocomplete.js b/src/components/SQForm/SQFormAutocomplete.js index e57cf3fe..22093e0a 100644 --- a/src/components/SQForm/SQFormAutocomplete.js +++ b/src/components/SQForm/SQFormAutocomplete.js @@ -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 => {