@spothero/ui 15.9.1 → 15.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {forwardRef
|
|
1
|
+
import React, {forwardRef} from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import FormControl from '../FormControl/FormControl';
|
|
4
4
|
import AsyncSelect from 'react-select/async';
|
|
@@ -23,13 +23,10 @@ const AutoSuggestSelect = forwardRef(
|
|
|
23
23
|
},
|
|
24
24
|
ref
|
|
25
25
|
) => {
|
|
26
|
-
const [query, setQuery] = useState('');
|
|
27
26
|
const {colors, fontSizes, sizes} = useTheme();
|
|
28
27
|
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
const loadOptions = () => {
|
|
32
|
-
return getOptions(query);
|
|
28
|
+
const handleChange = selectedOption => {
|
|
29
|
+
onChange(selectedOption);
|
|
33
30
|
};
|
|
34
31
|
|
|
35
32
|
const icon = (color = 'transparent') => ({
|
|
@@ -144,15 +141,15 @@ const AutoSuggestSelect = forwardRef(
|
|
|
144
141
|
<AsyncSelect
|
|
145
142
|
closeMenuOnSelect
|
|
146
143
|
isClearable
|
|
144
|
+
cacheOptions
|
|
147
145
|
components={{
|
|
148
146
|
DropdownIndicator: () => null,
|
|
149
147
|
IndicatorSeparator: () => null,
|
|
150
148
|
ClearIndicator,
|
|
151
149
|
}}
|
|
152
150
|
openMenuOnClick={false}
|
|
153
|
-
loadOptions={
|
|
154
|
-
|
|
155
|
-
onChange={onChange}
|
|
151
|
+
loadOptions={getOptions}
|
|
152
|
+
onChange={handleChange}
|
|
156
153
|
isDisabled={isDisabled}
|
|
157
154
|
id={id}
|
|
158
155
|
placeholder={placeholder}
|