This repository was archived by the owner on Mar 4, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +7
-0
lines changed Expand file tree Collapse file tree 3 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
25
25
26
26
### Features
27
27
- Move ` Input ` styles to Base theme @layershifter ([ #1247 ] ( https://github.com/stardust-ui/react/pull/1247 ) )
28
+ - Add ` role ` attribute to ` Popup ` 's content in accessibility behaviors @sophieH29 ([ 1253] ( https://github.com/stardust-ui/react/pull/1253 ) )
28
29
29
30
<!-- ------------------------------[ v0.28.1 ]------------------------------- -->
30
31
## [ v0.28.1] ( https://github.com/stardust-ui/react/tree/v0.28.1 ) (2019-04-23)
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import * as _ from 'lodash'
8
8
*
9
9
* @specification
10
10
* Adds attribute 'aria-disabled=true' to 'trigger' component's part if 'disabled' property is true. Does not set the attribute otherwise.
11
+ * Adds attribute 'role=complementary' to 'popup' component's part.
11
12
*/
12
13
const popupBehavior : Accessibility = ( props : any ) => {
13
14
const onAsArray = _ . isArray ( props . on ) ? props . on : [ props . on ]
@@ -21,6 +22,9 @@ const popupBehavior: Accessibility = (props: any) => {
21
22
? true
22
23
: undefined ,
23
24
} ,
25
+ popup : {
26
+ role : 'complementary' ,
27
+ } ,
24
28
} ,
25
29
keyActions : {
26
30
popup : {
Original file line number Diff line number Diff line change @@ -9,13 +9,15 @@ import popupBehavior from './popupBehavior'
9
9
* @specification
10
10
* Adds attribute 'aria-disabled=true' to 'trigger' component's part if 'disabled' property is true. Does not set the attribute otherwise.
11
11
* Adds attribute 'aria-modal=true' to 'popup' component's part.
12
+ * Adds attribute 'role=dialog' to 'popup' component's part.
12
13
* Traps focus inside component.
13
14
*/
14
15
const popupFocusTrapBehavior : Accessibility = ( props : any ) => {
15
16
const behaviorData = popupBehavior ( props )
16
17
behaviorData . attributes . popup = {
17
18
...behaviorData . attributes . popup ,
18
19
'aria-modal' : true ,
20
+ role : 'dialog' ,
19
21
}
20
22
behaviorData . focusTrap = true
21
23
You can’t perform that action at this time.
0 commit comments