@availity/mui-autocomplete 1.0.3-alpha.0 → 1.0.3-beta.1
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/CHANGELOG.md +17 -1
- package/package.json +1 -1
- package/src/lib/AsyncAutocomplete.tsx +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,12 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [1.0.3-beta.1](https://github.com/Availity/element/compare/@availity/mui-autocomplete@1.0.3-beta.0...@availity/mui-autocomplete@1.0.3-beta.1) (2025-03-06)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **mui-autocomplete:** reset value on blur to account for search ([1998342](https://github.com/Availity/element/commit/199834225ab2f93f9ab0c81e1c66fa0f70d248b7))
|
|
11
|
+
|
|
12
|
+
## [1.0.3-beta.0](https://github.com/Availity/element/compare/@availity/mui-autocomplete@1.0.2...@availity/mui-autocomplete@1.0.3-beta.0) (2025-03-06)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **mui-autocomplete:** reset value on blur when filter returns no results ([29e3d8f](https://github.com/Availity/element/commit/29e3d8f9605d7d1b8886187dfe27557e5e830427))
|
|
18
|
+
|
|
5
19
|
## [1.0.3-alpha.0](https://github.com/Availity/element/compare/@availity/mui-autocomplete@1.0.2...@availity/mui-autocomplete@1.0.3-alpha.0) (2025-03-06)
|
|
6
20
|
|
|
7
21
|
|
|
8
22
|
### Bug Fixes
|
|
9
23
|
|
|
10
|
-
* **mui-autocomplete:**
|
|
24
|
+
* **mui-autocomplete:** reset value on blur when filter returns no results ([29e3d8f](https://github.com/Availity/element/commit/29e3d8f9605d7d1b8886187dfe27557e5e830427))
|
|
25
|
+
|
|
26
|
+
## [1.0.3](https://github.com/Availity/element/compare/@availity/mui-autocomplete@1.0.2...@availity/mui-autocomplete@1.0.3) (2025-03-06)
|
|
11
27
|
|
|
12
28
|
## [1.0.2](https://github.com/Availity/element/compare/@availity/mui-autocomplete@1.0.1...@availity/mui-autocomplete@1.0.2) (2025-03-03)
|
|
13
29
|
|
package/package.json
CHANGED
|
@@ -35,6 +35,8 @@ export interface AsyncAutocompleteProps<
|
|
|
35
35
|
debounceTimeout?: number;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
const shouldSetInputValue = (reason: string) => ['blur', 'clear'].includes(reason);
|
|
39
|
+
|
|
38
40
|
export const AsyncAutocomplete = <
|
|
39
41
|
Option,
|
|
40
42
|
Multiple extends boolean | undefined = false,
|
|
@@ -78,8 +80,10 @@ export const AsyncAutocomplete = <
|
|
|
78
80
|
value: string,
|
|
79
81
|
reason: AutocompleteInputChangeReason
|
|
80
82
|
) => {
|
|
81
|
-
if (reason === 'clear'
|
|
83
|
+
if (reason === 'clear') {
|
|
82
84
|
setInputValue(event.target.value);
|
|
85
|
+
} else if (reason === 'blur') {
|
|
86
|
+
setInputValue(value);
|
|
83
87
|
}
|
|
84
88
|
|
|
85
89
|
if (onInputChange) onInputChange(event, value, reason);
|