summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibGUI')
-rw-r--r--Userland/Libraries/LibGUI/ComboBox.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGUI/ComboBox.cpp b/Userland/Libraries/LibGUI/ComboBox.cpp
index 5eee3508ab..e84846b523 100644
--- a/Userland/Libraries/LibGUI/ComboBox.cpp
+++ b/Userland/Libraries/LibGUI/ComboBox.cpp
@@ -193,8 +193,11 @@ void ComboBox::set_selected_index(size_t index)
{
if (!m_list_view->model())
return;
+ size_t previous_index = selected_index();
TemporaryChange change(m_updating_model, true);
m_list_view->set_cursor(m_list_view->model()->index(index, 0), AbstractView::SelectionUpdate::Set);
+ if (previous_index != selected_index() && on_change)
+ on_change(m_editor->text(), m_list_view->cursor_index());
}
size_t ComboBox::selected_index() const