This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
shell/platform/darwin/ios/framework/Source Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -524,6 +524,17 @@ - (BOOL)onCustomAccessibilityAction:(FlutterCustomAccessibilityAction*)action {
524
524
return YES ;
525
525
}
526
526
527
+ - (NSString *)accessibilityIdentifier {
528
+ if (![self isAccessibilityBridgeAlive ]) {
529
+ return nil ;
530
+ }
531
+
532
+ if ([self node ].identifier .empty ()) {
533
+ return nil ;
534
+ }
535
+ return @([self node ].identifier .data ());
536
+ }
537
+
527
538
- (NSString *)accessibilityLabel {
528
539
if (![self isAccessibilityBridgeAlive ]) {
529
540
return nil ;
Original file line number Diff line number Diff line change @@ -508,6 +508,20 @@ - (void)testFlutterScrollableSemanticsObjectIsHiddenWhenVoiceOverIsRunning {
508
508
XCTAssertFalse (scrollView.isAccessibilityElement );
509
509
}
510
510
511
+ - (void )testFlutterSemanticsObjectHasIdentifier {
512
+ flutter::testing::MockAccessibilityBridge* mock = new flutter::testing::MockAccessibilityBridge ();
513
+ mock->isVoiceOverRunningValue = true ;
514
+ fml::WeakPtrFactory<flutter::AccessibilityBridgeIos> factory (mock);
515
+ fml::WeakPtr<flutter::AccessibilityBridgeIos> bridge = factory.GetWeakPtr ();
516
+
517
+ flutter::SemanticsNode node;
518
+ node.identifier = " identifier" ;
519
+
520
+ FlutterSemanticsObject* object = [[FlutterSemanticsObject alloc ] initWithBridge: bridge uid: 0 ];
521
+ [object setSemanticsNode: &node];
522
+ XCTAssertTrue ([object.accessibilityIdentifier isEqualToString: @" identifier" ]);
523
+ }
524
+
511
525
- (void )testFlutterScrollableSemanticsObjectWithLabelValueHintIsNotHiddenWhenVoiceOverIsRunning {
512
526
flutter::testing::MockAccessibilityBridge* mock = new flutter::testing::MockAccessibilityBridge ();
513
527
mock->isVoiceOverRunningValue = true ;
You can’t perform that action at this time.
0 commit comments