Skip to content

Commit

Permalink
Support aria-label / alt
Browse files Browse the repository at this point in the history
  • Loading branch information
janicduplessis committed Sep 11, 2024
1 parent dc0b7a4 commit 12fd01d
Show file tree
Hide file tree
Showing 3 changed files with 2,614 additions and 37 deletions.
2 changes: 1 addition & 1 deletion packages/web-image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"devDependencies": {
"@react-native-community/bob": "^0.13.1",
"@types/react": "^17.0.19",
"@types/react-native": "^0.64.13",
"@types/react-native": "^0.73.0",
"react": "^16.13.1",
"react-native-web": "^0.12.2",
"typescript": "^4.4.2"
Expand Down
4 changes: 3 additions & 1 deletion packages/web-image/src/Image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ export const Image = React.forwardRef<View, ImageProps>(
source,
resizeMode: propsResizeMode,
accessibilityLabel,
'aria-label': ariaLabel,
alt,
width,
height,
critical,
Expand Down Expand Up @@ -335,7 +337,7 @@ export const Image = React.forwardRef<View, ImageProps>(
}}
src={resolvedSource.uri}
loading={critical ? 'eager' : 'lazy'}
alt={accessibilityLabel}
alt={alt ?? ariaLabel ?? accessibilityLabel}
width={resolvedSource.width}
height={resolvedSource.height}
draggable={draggable}
Expand Down
Loading

0 comments on commit 12fd01d

Please sign in to comment.