Skip to content

Commit 50930cd

Browse files
authored
Merge branch 'master' into add-option-role
2 parents d5932ec + 06e3488 commit 50930cd

23 files changed

+587
-120
lines changed

cypress/fixtures/selectors.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"indicatorClear": ".react-select__clear-indicator",
1111
"indicatorDropdown": ".react-select__dropdown-indicator",
1212
"menu": ".react-select__menu",
13+
"control": ".react-select__control",
1314
"menuOption": ".react-select__option",
1415
"noOptionsValue": ".react-select__menu-notice--no-options",
1516
"placeholder": ".react-select__placeholder",

cypress/integration/single-select.spec.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,11 @@ describe('Single Select', () => {
107107
.click({ force: true })
108108
.find('input')
109109
.should('exist')
110-
.should('be.disabled');
110+
.should('be.disabled')
111+
// control should have aria-disabled
112+
.get(selector.singleBasicSelect)
113+
.find(selector.control)
114+
.should('have.attr', 'aria-disabled', 'true');
111115
});
112116

113117
it(`Should filter options when searching in view: ${viewport}`, () => {

docs/pages/typescript/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,19 @@ const onChange = (option: readonly Option[], actionMeta: ActionMeta<Option>) =>
8484
}
8585
~~~
8686
87-
The \`actionMeta\` parameter is optional. \`ActionMeta\` is a union that is discriminated on the \`action\` type. Take a look at at [types.ts](https://github.com/JedWatson/react-select/blob/master/packages/react-select/src/types.ts) in the source code to see its full definition.
87+
The \`actionMeta\` parameter is optional. \`ActionMeta\` is a union that is discriminated on the \`action\` type. Take a look at [types.ts](https://github.com/JedWatson/react-select/blob/master/packages/react-select/src/types.ts) in the source code to see its full definition.
8888
8989
## Custom Select props
9090
9191
You can use module augmentation to add custom props to the \`Select\` prop types:
9292
9393
~~~jsx
94-
declare module 'react-select/dist/declarations/src/Select' {
94+
import type {} from 'react-select/base';
95+
// This import is necessary for module augmentation.
96+
// It allows us to extend the 'Props' interface in the 'react-select/base' module
97+
// and add our custom property 'myCustomProp' to it.
98+
99+
declare module 'react-select/base' {
95100
export interface Props<
96101
Option,
97102
IsMulti extends boolean,

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@
5858
"jest-in-case": "^1.0.2",
5959
"prettier": "^2.2.1",
6060
"style-loader": "^0.23.1",
61-
"typescript": "^4.1.3"
61+
"typescript": "^4.1.3",
62+
"user-agent-data-types": "^0.4.2"
6263
},
6364
"scripts": {
6465
"build": "preconstruct build",

packages/react-select/CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,45 @@
11
# react-select
22

3+
## 5.8.0
4+
5+
### Minor Changes
6+
7+
- [`884f1c42`](https://github.com/JedWatson/react-select/commit/884f1c42549faad7cb210169223b427ad6f0c9fd) [#5758](https://github.com/JedWatson/react-select/pull/5758) Thanks [@Ke1sy](https://github.com/Ke1sy)! - 1. Added 'aria-activedescendant' for input and functionality to calculate it;
8+
9+
2. Added role 'option' and 'aria-selected' for option;
10+
3. Added role 'listbox' for menu;
11+
4. Added tests for 'aria-activedescendant';
12+
5. Changes in aria-live region:
13+
14+
- the instructions how to use select will be announced only one time when user focuses the input for the first time.
15+
- instructions for menu or selected value will be announced only once after focusing them.
16+
- removed aria-live for focused option because currently with correct aria-attributes it will be announced by screenreader natively as well as the status of this option (active or disabled).
17+
- separated ariaContext into ariaFocused, ariaResults, ariaGuidance to avoid announcing redundant information and higlight only current change.
18+
19+
## 5.7.7
20+
21+
### Patch Changes
22+
23+
- [`224a8f0d`](https://github.com/JedWatson/react-select/commit/224a8f0d01a5b6200ff10280a0d7a9b613383032) [#5666](https://github.com/JedWatson/react-select/pull/5666) Thanks [@yhy-1](https://github.com/yhy-1)! - Add aria-disabled to select's control component.
24+
25+
## 5.7.6
26+
27+
### Patch Changes
28+
29+
- [`f6315cd5`](https://github.com/JedWatson/react-select/commit/f6315cd5feddb2e9ea168bcad391b29990b53afb) [#5672](https://github.com/JedWatson/react-select/pull/5672) Thanks [@tu4mo](https://github.com/tu4mo)! - Fix for calling non-cancellable scroll events
30+
31+
## 5.7.5
32+
33+
### Patch Changes
34+
35+
- [`9d1730ba`](https://github.com/JedWatson/react-select/commit/9d1730ba4f97a51d25c7e704acd1a4c2be8f7182) [#5347](https://github.com/JedWatson/react-select/pull/5347) Thanks [@aszmyd](https://github.com/aszmyd)! - Make scroll lock div work on a document context it belongs to
36+
37+
## 5.7.4
38+
39+
### Patch Changes
40+
41+
- [`16414bb5`](https://github.com/JedWatson/react-select/commit/16414bb53295b362690d2b089d74182ddeabc1dd) [#5689](https://github.com/JedWatson/react-select/pull/5689) Thanks [@Rall3n](https://github.com/Rall3n)! - Resolve `defaultProps` deprecation warning for React v18+.
42+
343
## 5.7.3
444

545
### Patch Changes

packages/react-select/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-select",
3-
"version": "5.7.3",
3+
"version": "5.8.0",
44
"description": "A Select control built with and for ReactJS",
55
"main": "dist/react-select.cjs.js",
66
"module": "dist/react-select.esm.js",

0 commit comments

Comments
 (0)