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 +21
-0
lines changed
shell/platform/darwin/ios/framework/Source Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -692,6 +692,13 @@ - (BOOL)accessibilityActivate {
692692 return NO ;
693693 }
694694 if (!self.node .HasAction (flutter::SemanticsAction::kTap )) {
695+ // Prevent sliders to receive a regular tap which will change the value.
696+ //
697+ // This is needed because it causes slider to select to middle if it
698+ // does not have a semantics tap.
699+ if (self.node .HasFlag (flutter::SemanticsFlags::kIsSlider )) {
700+ return YES ;
701+ }
695702 return NO ;
696703 }
697704 self.bridge ->DispatchSemanticsAction (self.uid , flutter::SemanticsAction::kTap );
Original file line number Diff line number Diff line change @@ -1206,4 +1206,18 @@ - (void)testUIFocusItemContainerConformance {
12061206 XCTAssertTrue ([itemsInRect containsObject: child1]);
12071207 XCTAssertTrue ([itemsInRect containsObject: child2]);
12081208}
1209+
1210+ - (void )testSliderSemanticsObject {
1211+ fml::WeakPtrFactory<flutter::AccessibilityBridgeIos> factory (
1212+ new flutter::testing::MockAccessibilityBridge ());
1213+ fml::WeakPtr<flutter::AccessibilityBridgeIos> bridge = factory.GetWeakPtr ();
1214+
1215+ flutter::SemanticsNode node;
1216+ node.flags = static_cast <int32_t >(flutter::SemanticsFlags::kIsSlider );
1217+ SemanticsObject* object = [[SemanticsObject alloc ] initWithBridge: bridge uid: 0 ];
1218+ [object setSemanticsNode: &node];
1219+ [object accessibilityBridgeDidFinishUpdate ];
1220+ XCTAssertEqual ([object accessibilityActivate ], YES );
1221+ }
1222+
12091223@end
You can’t perform that action at this time.
0 commit comments