Commit 9b9dc2c8 authored by Anastasia Helfinstein's avatar Anastasia Helfinstein Committed by Commit Bot

[Switch Access] Properly position back button on menu open

Currently, when the menu opens, the back button appears 8 pixels too
far from the menu, and it jumps closer when the back button is initially
focused. Upon investigation, this is because the resting bounds
calculated when the menu opens include 8 pixels of padding. This change
insets by the padding size so the position is correct upon opening.

AX-Relnotes: n/a.
Bug: 1094069
Change-Id: Ie10525bb03dc0d884feb0281bcc1e2f81e5e928c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2242082Reviewed-by: default avatarYoshiki Iguchi <yoshiki@chromium.org>
Commit-Queue: Anastasia Helfinstein <anastasi@google.com>
Cr-Commit-Position: refs/heads/master@{#778419}
parent 0dbe144b
......@@ -84,6 +84,11 @@ void SwitchAccessMenuBubbleController::ShowMenu(
widget_->Show();
bubble_view_->NotifyAccessibilityEvent(ax::mojom::Event::kChildrenChanged,
true);
// The resting bounds includes padding on each side of the menu.
// Remove that before passing to the back button controller so the back button
// appears in the correct position.
resting_bounds.Inset(kUnifiedMenuPadding, kUnifiedMenuPadding);
back_button_controller_->ShowBackButton(resting_bounds,
/*show_focus_ring=*/false,
/*for_menu=*/true);
......
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