From e6dc678949971fff37c258d53a8346e4398eade4 Mon Sep 17 00:00:00 2001 From: Gautam Kumar Date: Thu, 5 Nov 2026 17:08:14 +0530 Subject: [PATCH] [ImageBackground] Forward aria-hidden and accessibilityElementsHidden to wrapper View --- .../Libraries/Image/ImageBackground.js | 6 +++++ .../Image/__tests__/ImageBackground-itest.js | 26 +++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/packages/react-native/Libraries/Image/ImageBackground.js b/packages/react-native/Libraries/Image/ImageBackground.js index 15e2243d98f2..47968f40ada4 100644 --- a/packages/react-native/Libraries/Image/ImageBackground.js +++ b/packages/react-native/Libraries/Image/ImageBackground.js @@ -75,6 +75,8 @@ class ImageBackground extends React.Component { imageStyle, imageRef, importantForAccessibility, + 'aria-hidden': ariaHidden, + accessibilityElementsHidden, ...props } = this.props; @@ -82,13 +84,17 @@ class ImageBackground extends React.Component { const flattenedStyle = flattenStyle(style); return ( {/* $FlowFixMe[incompatible-use] */} ', () => { ); }); }); + + describe('aria-hidden', () => { + it('is set on both the wrapper `View` and the inner `Image`', () => { + const root = Fantom.createRoot(); + + Fantom.runTask(() => { + root.render( + , + ); + }); + + expect( + root + .getRenderedOutput({props: ['importantForAccessibility']}) + .toJSX(), + ).toEqual( + + + , + ); + }); + }); }); describe('ref', () => {