File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
shell/platform/darwin/ios/framework/Source Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,9 @@ enum class SemanticsFlags : int32_t {
7171 kHasImplicitScrolling = 1 << 18 ,
7272};
7373
74+ const int kScrollableSemanticsFlags =
75+ static_cast <int32_t >(SemanticsFlags::kHasImplicitScrolling );
76+
7477struct SemanticsNode {
7578 SemanticsNode ();
7679
Original file line number Diff line number Diff line change @@ -171,7 +171,16 @@ - (BOOL)isAccessibilityElement {
171171 if ([self node ].HasFlag (flutter::SemanticsFlags::kScopesRoute ))
172172 return false ;
173173
174- return ([self node ].flags != 0 &&
174+ // If the only flag(s) set are scrolling related AND
175+ // The only flags set are not kIsHidden OR
176+ // The node doesn't have a label, value, or hint OR
177+ // The only actions set are scrolling related actions.
178+ //
179+ // The kIsHidden flag set with any other flag just means this node is now
180+ // hidden but still is a valid target for a11y focus in the tree, e.g. a list
181+ // item that is currently off screen but the a11y navigation needs to know
182+ // about.
183+ return (([self node ].flags & ~flutter::kScrollableSemanticsFlags ) != 0 &&
175184 [self node ].flags != static_cast <int32_t >(flutter::SemanticsFlags::kIsHidden )) ||
176185 ![self node ].label .empty () || ![self node ].value .empty () || ![self node ].hint .empty () ||
177186 ([self node ].actions & ~flutter::kScrollableSemanticsActions ) != 0 ;
You can’t perform that action at this time.
0 commit comments