1717
1818@implementation RNSFullWindowOverlayContainer
1919
20- - (instancetype )initWithFrame : (CGRect)frame
20+ - (instancetype )initWithFrame : (CGRect)frame accessibilityViewIsModal : ( BOOL ) accessibilityViewIsModal
2121{
2222 if (self = [super initWithFrame: frame]) {
23- self.accessibilityViewIsModal = YES ;
23+ self.accessibilityViewIsModal = accessibilityViewIsModal ;
2424 }
2525 return self;
2626}
@@ -92,29 +92,37 @@ - (instancetype)init
9292 if (self = [super init ]) {
9393 static const auto defaultProps = std::make_shared<const react::RNSFullWindowOverlayProps>();
9494 _props = defaultProps;
95- [self _initCommon ];
95+ [self initCommonProps ];
9696 }
9797 return self;
9898}
99- #endif // RCT_NEW_ARCH_ENABLED
100-
99+ #else
101100- (instancetype )initWithBridge : (RCTBridge *)bridge
102101{
103102 if (self = [super init ]) {
104103 _bridge = bridge;
105- [self _initCommon ];
104+ [self initCommonProps ];
106105 }
107106
108107 return self;
109108}
109+ #endif // RCT_NEW_ARCH_ENABLED
110110
111- - (void )_initCommon
111+ - (void )initCommonProps
112112{
113+ // Default value used by container.
114+ _containerAccessibilityViewIsModal = YES ;
113115 _reactFrame = CGRectNull;
114116 _container = self.container ;
115117 [self show ];
116118}
117119
120+ - (void )setContainerAccessibilityViewIsModal : (BOOL )containerAccessibilityViewIsModal
121+ {
122+ _containerAccessibilityViewIsModal = containerAccessibilityViewIsModal;
123+ self.container .accessibilityViewIsModal = containerAccessibilityViewIsModal;
124+ }
125+
118126- (void )addSubview : (UIView *)view
119127{
120128 [_container addSubview: view];
@@ -123,7 +131,8 @@ - (void)addSubview:(UIView *)view
123131- (RNSFullWindowOverlayContainer *)container
124132{
125133 if (_container == nil ) {
126- _container = [[RNSFullWindowOverlayContainer alloc ] initWithFrame: _reactFrame];
134+ _container = [[RNSFullWindowOverlayContainer alloc ] initWithFrame: _reactFrame
135+ accessibilityViewIsModal: _containerAccessibilityViewIsModal];
127136 }
128137
129138 return _container;
@@ -220,6 +229,19 @@ - (void)updateLayoutMetrics:(react::LayoutMetrics const &)layoutMetrics
220229
221230RNS_IGNORE_SUPER_CALL_END
222231
232+ - (void )updateProps : (const facebook::react::Props::Shared &)props
233+ oldProps : (const facebook::react::Props::Shared &)oldProps
234+ {
235+ const auto &oldComponentProps = *std::static_pointer_cast<react::RNSFullWindowOverlayProps>(_props);
236+ const auto &newComponentProps = *std::static_pointer_cast<const react::RNSFullWindowOverlayProps>(props);
237+
238+ if (newComponentProps.containerAccessibilityViewIsModal != oldComponentProps.containerAccessibilityViewIsModal ) {
239+ [self setContainerAccessibilityViewIsModal: newComponentProps.containerAccessibilityViewIsModal];
240+ }
241+
242+ [super updateProps: props oldProps: oldProps];
243+ }
244+
223245#else
224246#pragma mark - Paper specific
225247
@@ -250,6 +272,8 @@ @implementation RNSFullWindowOverlayManager
250272
251273RCT_EXPORT_MODULE ()
252274
275+ RCT_EXPORT_VIEW_PROPERTY(containerAccessibilityViewIsModal, BOOL )
276+
253277#ifdef RCT_NEW_ARCH_ENABLED
254278#else
255279- (UIView *)view
0 commit comments