Commit 9b173f86 authored by Bret Sepulveda's avatar Bret Sepulveda Committed by Commit Bot

Fix not being able to select radio buttons with the arrow keys.

Restores the OnFocus > SetChecked line in RadioButton removed in
https://chromium-review.googlesource.com/c/547075, which is required
to let the user move the radio selection with the arrow keys.

Bug: 749014
Change-Id: I861f64b3abbcaac2ec762c7014e5b5e6bee8965b
Reviewed-on: https://chromium-review.googlesource.com/595231Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Bret Sepulveda <bsep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491132}
parent 8a65d550
......@@ -97,6 +97,11 @@ bool RadioButton::IsGroupFocusTraversable() const {
return false;
}
void RadioButton::OnFocus() {
Checkbox::OnFocus();
SetChecked(true);
}
void RadioButton::NotifyClick(const ui::Event& event) {
// Set the checked state to true only if we are unchecked, since we can't
// be toggled on and off like a checkbox.
......
......@@ -26,6 +26,7 @@ class VIEWS_EXPORT RadioButton : public Checkbox {
void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
View* GetSelectedViewForGroup(int group) override;
bool IsGroupFocusTraversable() const override;
void OnFocus() override;
// Overridden from Button:
void NotifyClick(const ui::Event& event) override;
......
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