Skip to content

Commit f03a96f

Browse files
Merge pull request #697 from Availity/fix/autocomplete-blur-clear-search
Fix/autocomplete blur clear search
2 parents 84c1446 + 794cd38 commit f03a96f

File tree

9 files changed

+47
-7
lines changed

9 files changed

+47
-7
lines changed

packages/autocomplete/CHANGELOG.md

+28
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,34 @@
22

33
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
44

5+
## [1.0.3-beta.2](https://github.com/Availity/element/compare/@availity/[email protected]...@availity/[email protected]) (2025-03-06)
6+
7+
8+
### Bug Fixes
9+
10+
* **mui-autocomplete:** reset value on blur to account for search ([3ba4edd](https://github.com/Availity/element/commit/3ba4eddde9cb36ef5cd29c28c1030ab8fa6f0bac))
11+
12+
## [1.0.3-beta.1](https://github.com/Availity/element/compare/@availity/[email protected]...@availity/[email protected]) (2025-03-06)
13+
14+
15+
### Bug Fixes
16+
17+
* **mui-autocomplete:** reset value on blur to account for search ([1998342](https://github.com/Availity/element/commit/199834225ab2f93f9ab0c81e1c66fa0f70d248b7))
18+
19+
## [1.0.3-beta.0](https://github.com/Availity/element/compare/@availity/[email protected]...@availity/[email protected]) (2025-03-06)
20+
21+
22+
### Bug Fixes
23+
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-alpha.0](https://github.com/Availity/element/compare/@availity/[email protected]...@availity/[email protected]) (2025-03-06)
27+
28+
29+
### Bug Fixes
30+
31+
* **mui-autocomplete:** reset value on blur when filter returns no results ([29e3d8f](https://github.com/Availity/element/commit/29e3d8f9605d7d1b8886187dfe27557e5e830427))
32+
533
## [1.0.3](https://github.com/Availity/element/compare/@availity/[email protected]...@availity/[email protected]) (2025-03-06)
634

735
## [1.0.2](https://github.com/Availity/element/compare/@availity/[email protected]...@availity/[email protected]) (2025-03-03)

packages/autocomplete/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@availity/mui-autocomplete",
3-
"version": "1.0.3",
3+
"version": "1.0.3-beta.2",
44
"description": "Availity MUI Autocomplete Component - part of the @availity/element design system",
55
"keywords": [
66
"react",

packages/autocomplete/src/lib/AsyncAutocomplete.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ export interface AsyncAutocompleteProps<
3535
debounceTimeout?: number;
3636
}
3737

38-
const shouldSetInputValue = (reason: string) => Boolean(reason === 'clear');
39-
4038
export const AsyncAutocomplete = <
4139
Option,
4240
Multiple extends boolean | undefined = false,
@@ -80,8 +78,10 @@ export const AsyncAutocomplete = <
8078
value: string,
8179
reason: AutocompleteInputChangeReason
8280
) => {
83-
if (shouldSetInputValue(reason)) {
81+
if (reason === 'clear') {
8482
setInputValue(event.target.value);
83+
} else if (reason === 'blur') {
84+
setInputValue(value);
8585
}
8686

8787
if (onInputChange) onInputChange(event, value, reason);

packages/codemod/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
44

5+
## [1.0.3-beta.0](https://github.com/Availity/element/compare/@availity/[email protected]...@availity/[email protected]) (2025-03-06)
6+
7+
## [1.0.3-alpha.0](https://github.com/Availity/element/compare/@availity/[email protected]...@availity/[email protected]) (2025-03-06)
8+
59
## [1.0.4](https://github.com/Availity/element/compare/@availity/[email protected]...@availity/[email protected]) (2025-03-06)
610

711
### Dependency Updates

packages/codemod/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@availity/mui-codemod",
3-
"version": "1.0.4",
3+
"version": "1.0.3-beta.0",
44
"description": "Availity MUI v1 Codemods - part of the @availity/element design system",
55
"keywords": [
66
"react",

packages/controlled-form/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
44

5+
## [1.0.3-beta.0](https://github.com/Availity/element/compare/@availity/[email protected]...@availity/[email protected]) (2025-03-06)
6+
7+
## [1.0.3-alpha.0](https://github.com/Availity/element/compare/@availity/[email protected]...@availity/[email protected]) (2025-03-06)
8+
59
## [1.0.3](https://github.com/Availity/element/compare/@availity/[email protected]...@availity/[email protected]) (2025-03-06)
610

711
### Dependency Updates

packages/controlled-form/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@availity/mui-controlled-form",
3-
"version": "1.0.3",
3+
"version": "1.0.3-beta.0",
44
"description": "Availity MUI/react-hook-form controlled form components - part of the @availity/element design system",
55
"keywords": [
66
"react",

packages/element/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
44

5+
## [1.0.3-beta.0](https://github.com/Availity/element/compare/@availity/[email protected]...@availity/[email protected]) (2025-03-06)
6+
7+
## [1.0.3-alpha.0](https://github.com/Availity/element/compare/@availity/[email protected]...@availity/[email protected]) (2025-03-06)
8+
59
## [1.0.4](https://github.com/Availity/element/compare/@availity/[email protected]...@availity/[email protected]) (2025-03-06)
610

711
### Dependency Updates

packages/element/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@availity/element",
3-
"version": "1.0.4",
3+
"version": "1.0.3-beta.0",
44
"browser": "./dist/index.js",
55
"main": "./dist/index.js",
66
"module": "./dist/index.mjs",

0 commit comments

Comments
 (0)