Skip to content

Commit 7c16385

Browse files
trcoffmandominicstop
authored andcommitted
Fix accessibility issues in Dropdown Menus
To VoiceOver, the dropdown menu trigger button is just read out as 'button'. This is because by default, a UIButton has isAccessibilityElement=true. This means that everything inside of it is invisible to the screen reader. In order to improve accessibility, it's necessary to set isAccessibilityElement to false so that the screen reader can access the react native component that the user has provided to be the trigger button for the context menu.
1 parent 4b0da8f commit 7c16385

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ios/RNIContextMenuButton/RNIContextMenuButtonContent.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ public final class RNIContextMenuButtonContent: UIButton, RNIContentView {
138138
self._didSetup = true;
139139

140140
self.isEnabled = true;
141+
self.isAccessibilityElement = false;
141142
};
142143

143144
// MARK: Functions

0 commit comments

Comments
 (0)