@@ -30,29 +30,29 @@ function updateNodeIndexes(node: Mutable<TNodeImpl>, i: number) {
3030const emptyAttrs = Object . freeze ( { } ) ;
3131const emptyClasses = Object . freeze ( [ ] ) ;
3232
33- function findNativeRole ( role : string ) : AccessibilityRole | undefined {
34- if ( role === 'img' ) {
33+ function findNativeRole ( ariaRole : string ) : AccessibilityRole | undefined {
34+ if ( ariaRole === 'img' ) {
3535 return 'image' ;
3636 }
37- if ( role === 'heading' ) {
37+ if ( ariaRole === 'heading' ) {
3838 return 'header' ;
3939 }
40- if ( role === 'dialog' ) {
40+ if ( ariaRole === 'dialog' ) {
4141 return 'alert' ;
4242 }
43- if ( role === 'presentation' ) {
43+ if ( ariaRole === 'presentation' ) {
4444 return 'none' ;
4545 }
4646 if (
47- role === 'button' ||
48- role === 'switch' ||
49- role === 'checkbox' ||
50- role === 'radio' ||
51- role === 'radiogroup' ||
52- role === 'link' ||
53- role === 'search'
47+ ariaRole === 'button' ||
48+ ariaRole === 'switch' ||
49+ ariaRole === 'checkbox' ||
50+ ariaRole === 'radio' ||
51+ ariaRole === 'radiogroup' ||
52+ ariaRole === 'link' ||
53+ ariaRole === 'search'
5454 ) {
55- return role ;
55+ return ariaRole ;
5656 }
5757}
5858
@@ -139,8 +139,8 @@ const prototype: Omit<TNodeImpl, 'displayName' | 'type'> = {
139139 text : accessibilityProps
140140 } ) ;
141141 }
142- if ( this . attributes [ 'aria- role' ] ) {
143- const role = this . attributes [ 'aria- role' ] ;
142+ if ( this . attributes . role ) {
143+ const role = this . attributes . role ;
144144 const accessibilityRole = findNativeRole ( role ) ;
145145 if ( accessibilityRole ) {
146146 const accessibilityProps : AccessibilityProps = {
0 commit comments