File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,8 @@ export function isAccessibilityElement(element: ReactTestInstance | null): boole
103
103
return false ;
104
104
}
105
105
106
- if ( isHostImage ( element ) && element . props . alt ) {
106
+ // https://github.com/facebook/react-native/blob/8dabed60f456e76a9e53273b601446f34de41fb5/packages/react-native/Libraries/Image/Image.ios.js#L172
107
+ if ( isHostImage ( element ) && element . props . alt !== undefined ) {
107
108
return true ;
108
109
}
109
110
@@ -162,11 +163,17 @@ export function computeAriaModal(element: ReactTestInstance): boolean | undefine
162
163
}
163
164
164
165
export function computeAriaLabel ( element : ReactTestInstance ) : string | undefined {
166
+ const explicitLabel = element . props [ 'aria-label' ] ?? element . props . accessibilityLabel ;
167
+ if ( explicitLabel ) {
168
+ return explicitLabel ;
169
+ }
170
+
171
+ //https://github.com/facebook/react-native/blob/8dabed60f456e76a9e53273b601446f34de41fb5/packages/react-native/Libraries/Image/Image.ios.js#L173
165
172
if ( isHostImage ( element ) && element . props . alt ) {
166
173
return element . props . alt ;
167
174
}
168
175
169
- return element . props [ 'aria-label' ] ?? element . props . accessibilityLabel ;
176
+ return undefined ;
170
177
}
171
178
172
179
export function computeAriaLabelledBy ( element : ReactTestInstance ) : string | undefined {
You can’t perform that action at this time.
0 commit comments