@availity/mui-autocomplete 0.8.4 → 0.8.5

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 CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.8.5](https://github.com/Availity/element/compare/@availity/mui-autocomplete@0.8.4...@availity/mui-autocomplete@0.8.5) (2024-10-18)
6
+
7
+ ### Dependency Updates
8
+
9
+ * `mui-form-utils` updated to version `0.8.4`
10
+ * `mui-textfield` updated to version `0.8.4`
11
+
12
+ ### Bug Fixes
13
+
14
+ * **mui-form-utils:** resolve aria-controls warnings ([487fe12](https://github.com/Availity/element/commit/487fe12229a2f1510f8e7ba76028f798896a1b20))
15
+
5
16
  ## [0.8.4](https://github.com/Availity/element/compare/@availity/mui-autocomplete@0.8.3...@availity/mui-autocomplete@0.8.4) (2024-10-01)
6
17
 
7
18
  ### Dependency Updates
package/dist/index.js CHANGED
@@ -117,7 +117,10 @@ var Autocomplete = (_a) => {
117
117
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LoadingIndicator, {})
118
118
  ] }) : (params == null ? void 0 : params.InputProps.endAdornment) || null
119
119
  }),
120
- inputProps: __spreadValues(__spreadValues({}, FieldProps == null ? void 0 : FieldProps.inputProps), params == null ? void 0 : params.inputProps)
120
+ inputProps: __spreadProps(__spreadValues(__spreadValues({}, FieldProps == null ? void 0 : FieldProps.inputProps), params == null ? void 0 : params.inputProps), {
121
+ // appease the Level Access scanning tools
122
+ "aria-controls": (params == null ? void 0 : params.inputProps["aria-controls"]) || ""
123
+ })
121
124
  });
122
125
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
123
126
  import_Autocomplete.default,
package/dist/index.mjs CHANGED
@@ -83,7 +83,10 @@ var Autocomplete = (_a) => {
83
83
  /* @__PURE__ */ jsx(LoadingIndicator, {})
84
84
  ] }) : (params == null ? void 0 : params.InputProps.endAdornment) || null
85
85
  }),
86
- inputProps: __spreadValues(__spreadValues({}, FieldProps == null ? void 0 : FieldProps.inputProps), params == null ? void 0 : params.inputProps)
86
+ inputProps: __spreadProps(__spreadValues(__spreadValues({}, FieldProps == null ? void 0 : FieldProps.inputProps), params == null ? void 0 : params.inputProps), {
87
+ // appease the Level Access scanning tools
88
+ "aria-controls": (params == null ? void 0 : params.inputProps["aria-controls"]) || ""
89
+ })
87
90
  });
88
91
  return /* @__PURE__ */ jsx(
89
92
  MuiAutocomplete,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@availity/mui-autocomplete",
3
- "version": "0.8.4",
3
+ "version": "0.8.5",
4
4
  "description": "Availity MUI Autocomplete Component - part of the @availity/element design system",
5
5
  "keywords": [
6
6
  "react",
@@ -37,8 +37,8 @@
37
37
  },
38
38
  "devDependencies": {
39
39
  "@availity/api-axios": "^9.0.0",
40
- "@availity/mui-form-utils": "^0.13.0",
41
- "@availity/mui-textfield": "^0.6.8",
40
+ "@availity/mui-form-utils": "^0.13.1",
41
+ "@availity/mui-textfield": "^0.6.9",
42
42
  "@mui/material": "^5.15.15",
43
43
  "@tanstack/react-query": "^4.36.1",
44
44
  "react": "18.2.0",
@@ -48,8 +48,8 @@
48
48
  },
49
49
  "peerDependencies": {
50
50
  "@availity/api-axios": "^8.0.7",
51
- "@availity/mui-form-utils": "^0.13.0",
52
- "@availity/mui-textfield": "^0.6.8",
51
+ "@availity/mui-form-utils": "^0.13.1",
52
+ "@availity/mui-textfield": "^0.6.9",
53
53
  "@mui/material": "^5.11.9",
54
54
  "@tanstack/react-query": "^4.36.1",
55
55
  "react": ">=16.3.0"
@@ -6,4 +6,15 @@ describe('Autocomplete', () => {
6
6
  const { getByLabelText } = render(<Autocomplete FieldProps={{ label: 'Test' }} options={['1', '2', '3']} />);
7
7
  expect(getByLabelText('Test')).toBeTruthy();
8
8
  });
9
+ test('aria-controls should be empty string when not open', () => {
10
+ const { getByRole } = render(<Autocomplete FieldProps={{ label: 'Test' }} options={['1', '2', '3']} />);
11
+ const combobox = getByRole('combobox')
12
+ expect(combobox.getAttribute('aria-controls')).toEqual('');
13
+ });
14
+ test('aria-controls should not be empty when open', () => {
15
+ const { getByRole } = render(<Autocomplete open FieldProps={{ label: 'Test' }} options={['1', '2', '3']} />);
16
+ const combobox = getByRole('combobox', { hidden: true })
17
+ expect(combobox.getAttribute('aria-controls')).not.toEqual('');
18
+ expect(combobox.getAttribute('aria-controls')).toMatch(':r');
19
+ });
9
20
  });
@@ -88,6 +88,8 @@ export const Autocomplete = <
88
88
  inputProps: {
89
89
  ...FieldProps?.inputProps,
90
90
  ...params?.inputProps,
91
+ // appease the Level Access scanning tools
92
+ 'aria-controls': params?.inputProps['aria-controls'] || '',
91
93
  },
92
94
  });
93
95