File tree Expand file tree Collapse file tree 3 files changed +16
-15
lines changed
packages/notifications/src/elements Expand file tree Collapse file tree 3 files changed +16
-15
lines changed Original file line number Diff line number Diff line change 9
9
10
10
_ Note: Gaps between patch versions are faulty, broken or test releases._
11
11
12
+ ## v8.76.1 (2024-04-18)
13
+
14
+ #### :bug : Bug Fix
15
+ * ` notifications `
16
+ * [ #1790 ] ( https://github.com/zendeskgarden/react-components/pull/1790 ) fix(Notifications): improve screen-reader support ([ @ze-flo ] ( https://github.com/ze-flo ) )
17
+
12
18
## v8.76.0 (2024-04-12)
13
19
14
20
#### :rocket : New Feature
Original file line number Diff line number Diff line change @@ -20,13 +20,14 @@ describe('Notification', () => {
20
20
it ( 'has a default role attribute' , ( ) => {
21
21
const { container } = render ( < Notification type = "success" /> ) ;
22
22
23
- expect ( container . firstChild ) . toHaveAttribute ( 'role' , 'status ' ) ;
23
+ expect ( container . firstChild ) . toHaveAttribute ( 'role' , 'alert ' ) ;
24
24
} ) ;
25
25
26
26
it ( 'can have its role attribute modified' , ( ) => {
27
- const { container } = render ( < Notification type = "error" role = "alert" /> ) ;
27
+ // eslint-disable-next-line jsx-a11y/prefer-tag-over-role
28
+ const { container } = render ( < Notification type = "error" role = "status" /> ) ;
28
29
29
- expect ( container . firstChild ) . toHaveAttribute ( 'role' , 'alert ' ) ;
30
+ expect ( container . firstChild ) . toHaveAttribute ( 'role' , 'status ' ) ;
30
31
} ) ;
31
32
32
33
it ( 'can have its role attribute removed' , ( ) => {
Original file line number Diff line number Diff line change @@ -16,25 +16,19 @@ import { Paragraph } from './content/Paragraph';
16
16
import { Close } from './content/Close' ;
17
17
18
18
export const NotificationComponent = forwardRef < HTMLDivElement , INotificationProps > (
19
- ( { role , ...props } , ref ) => {
20
- const Icon = props . type ? validationIcons [ props . type ] : InfoStrokeIcon ;
21
- const hue = props . type && validationHues [ props . type ] ;
19
+ ( { children , type , ...props } , ref ) => {
20
+ const Icon = type ? validationIcons [ type ] : InfoStrokeIcon ;
21
+ const hue = type && validationHues [ type ] ;
22
22
23
23
return (
24
- < StyledNotification
25
- ref = { ref }
26
- type = { props . type }
27
- isFloating
28
- { ...props }
29
- role = { role === undefined ? 'status' : role }
30
- >
31
- { props . type && (
24
+ < StyledNotification ref = { ref } type = { type } isFloating role = "alert" { ...props } >
25
+ { type && (
32
26
< StyledIcon $hue = { hue } >
33
27
< Icon />
34
28
</ StyledIcon >
35
29
) }
36
30
37
- { props . children }
31
+ { children }
38
32
</ StyledNotification >
39
33
) ;
40
34
}
You can’t perform that action at this time.
0 commit comments