From ef8b3c0098bcf237137e76f31a3ccbf2b1c53198 Mon Sep 17 00:00:00 2001 From: Devan Buggay Date: Thu, 15 Oct 2026 09:30:27 -0700 Subject: [PATCH] Avoid VoiceOver interruptions from hidden text updates Summary: Honor `accessibilityElementsHidden` on text and its ancestors before posting layout-change notifications for changed text. This prevents hidden text updates from interrupting VoiceOver announcements for visible content. Differential Revision: D124686835 --- .../ComponentViews/Text/RCTParagraphComponentView.mm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm index f1e1d564e404..da6658cc1319 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm @@ -145,6 +145,14 @@ - (void)updateState:(const State::Shared &)state oldState:(const State::Shared & const auto &newData = std::static_pointer_cast(state)->getData(); const auto &oldData = std::static_pointer_cast(oldState)->getData(); if (!newData.attributedString.isContentEqual(oldData.attributedString)) { + // Changes inside a hidden subtree must not interrupt VoiceOver on visible content. + UIView *view = self; + while (view != nil) { + if (view.accessibilityElementsHidden) { + return; + } + view = view.superview; + } UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, nil); } }