Skip to content

Add aria-level, aria-posinset and aria-setsize in Image #14721

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Add aria-level, aria-posinset and aria-setsize in Image",
"packageName": "react-native-windows",
"email": "54227869+anupriya13@users.noreply.github.com",
"dependentChangeType": "patch"
}
3 changes: 3 additions & 0 deletions packages/playground/Samples/image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ export default class Bootstrap extends React.Component<
onLoadStart={() => console.log('onLoadStart')}
onLoadEnd={() => console.log('onLoadEnd')}
onProgress={this.handleOnProgress}
aria-level={1}
aria-posinset={10}
aria-setsize={100}
/>
)}
</View>
Expand Down
14 changes: 13 additions & 1 deletion vnext/src-win/Libraries/Image/Image.windows.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ let BaseImage: AbstractImageIOS = React.forwardRef((props, forwardedRef) => {
'aria-selected': ariaSelected,
'aria-readonly': ariaReadOnly, // Windows
'aria-multiselectable': ariaMultiselectable, // Windows
'aria-required': ariaRequired, // Windows
'aria-required': ariaRequired, // Windows,
'aria-level': ariaLevel, // Windows
'aria-posinset': ariaPosinset, // Windows
'aria-setsize': ariaSetsize, // Windows
height,
src,
...restProps
Expand All @@ -167,6 +170,9 @@ let BaseImage: AbstractImageIOS = React.forwardRef((props, forwardedRef) => {
required: ariaRequired ?? props.accessibilityState?.required, // Windows
};
const accessibilityLabel = props['aria-label'] ?? props.accessibilityLabel;
const accessibilityLevel = ariaLevel ?? props.accessibilityLevel; // Windows
const accessibilityPosInSet = ariaPosinset ?? props.accessibilityPosInSet; // Windows
const accessibilitySetSize = ariaSetsize ?? props.accessibilitySetSize; // Windows

const actualRef = useWrapRefWithImageAttachedCallbacks(forwardedRef);

Expand All @@ -189,6 +195,9 @@ let BaseImage: AbstractImageIOS = React.forwardRef((props, forwardedRef) => {
{...restProps}
accessible={props.alt !== undefined ? true : props.accessible}
accessibilityLabel={accessibilityLabel ?? props.alt}
accessibilityLevel={accessibilityLevel} // Windows
accessibilityPosInSet={accessibilityPosInSet} // Windows
accessibilitySetSize={accessibilitySetSize} // Windows
ref={actualRef}
style={style}
resizeMode={resizeMode}
Expand All @@ -211,6 +220,9 @@ let BaseImage: AbstractImageIOS = React.forwardRef((props, forwardedRef) => {
{...restProps}
accessible={props.alt !== undefined ? true : props.accessible}
accessibilityLabel={accessibilityLabel ?? props.alt}
accessibilityLevel={accessibilityLevel} // Windows
accessibilityPosInSet={accessibilityPosInSet} // Windows
accessibilitySetSize={accessibilitySetSize} // Windows
ref={actualRef}
style={style}
resizeMode={resizeMode}
Expand Down
Loading