[ Bug Fix ] Combobox does not run callback on index change
Changing the selection index of the combobox in the side panel via
arrow keys or letter keys on the keyboard ('r', 'b', etc.) would not
update contents of the side panel.
This fix solves this issue by running the callback when a new selection
index is registered / selected.
Bug: 1355882
Change-Id: Iea92d4f565233627d14d6ce42fade2ddfc038cd0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3946284
Commit-Queue: Darryl James <dljames@chromium.org>
Reviewed-by: Allen Bauer <kylixrd@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1058081}
diff --git a/ui/views/controls/combobox/combobox.cc b/ui/views/controls/combobox/combobox.cc
index 8ece700..1be7478 100644
--- a/ui/views/controls/combobox/combobox.cc
+++ b/ui/views/controls/combobox/combobox.cc
@@ -432,6 +432,9 @@
}
if (new_index.has_value()) {
+ if (menu_selection_at_callback_)
+ menu_selection_at_callback_.Run(new_index.value());
+
SetSelectedIndex(new_index);
OnPerformAction();
}