Commit e7710ecd authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

[iOS] Fix VoiceOver for PopupMenu

This CL fixes the select action with VoiceOver, allowing to close the
popup menus using the "Close Menu" scrim.

Bug: 936850
Change-Id: Ifd245eed2f4d302d8aa959aae3f441c2199f31ee
Reviewed-on: https://chromium-review.googlesource.com/c/1496890Reviewed-by: default avatarOlivier Robin <olivierrobin@chromium.org>
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#636875}
parent 3e715045
......@@ -15,6 +15,18 @@
#error "This file requires ARC support."
#endif
// UIButton allowing the user to close the menu with VoiceOver.
@interface PopupMenuCloseButton : UIButton
@end
@implementation PopupMenuCloseButton
// If accessibilityActivate isn't overriden, VoiceOver isn't able to close the
// menu.
- (BOOL)accessibilityActivate {
return [super accessibilityActivate];
}
@end
namespace {
const CGFloat kImageMargin = 196;
const CGFloat kBackgroundGreyScale = 0.98;
......@@ -36,7 +48,8 @@ const CGFloat kBackgroundAlpha = 0.65;
- (instancetype)init {
self = [super initWithNibName:nil bundle:nil];
if (self) {
UIButton* closeButton = [UIButton buttonWithType:UIButtonTypeCustom];
UIButton* closeButton =
[PopupMenuCloseButton buttonWithType:UIButtonTypeCustom];
[closeButton addTarget:self
action:@selector(dismissPopup)
forControlEvents:UIControlEventTouchUpInside];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment