Combo: Made simple/legacy Combo() function not returns true when picking already selected item. (#1182)
diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt
index 1545cf8..403935a 100644
--- a/docs/CHANGELOG.txt
+++ b/docs/CHANGELOG.txt
@@ -88,6 +88,8 @@
- CollapsingHeader/TreeNode: Fixed text padding when using _Framed+_Leaf flags. (#6549) [@BobbyAnguelov]
- InputText: Fixed not returning true when buffer is cleared while using the
ImGuiInputTextFlags_EscapeClearsAll flag. (#5688, #2620)
+- Combo: Made simple/legacy Combo() function not returns true when picking already selected item.
+ This is consistent with other widgets. If you need something else, you can use BeginCombo(). (#1182)
- Clipper: Rework inner logic to allow functioning with a zero-clear constructor.
This is order to facilitate usage for language bindings (e.g cimgui or dear_binding)
where user may not be callinga constructor manually. (#5856)
diff --git a/docs/TODO.txt b/docs/TODO.txt
index 28b715d..5fb8293 100644
--- a/docs/TODO.txt
+++ b/docs/TODO.txt
@@ -167,7 +167,6 @@
- drag float: added leeway on edge (e.g. a few invisible steps past the clamp limits)
- combo: use clipper.
- - combo: flag for BeginCombo to not return true when unchanged (#1182)
- combo: a way/helper to customize the combo preview (#1658) -> experimental BeginComboPreview()
- combo/listbox: keyboard control. need InputText-like non-active focus + key handling. considering keyboard for custom listbox (pr #203)
- listbox: multiple selection (WIP range-select branch)
diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp
index ecdb2d6..67e5d3a 100644
--- a/imgui_widgets.cpp
+++ b/imgui_widgets.cpp
@@ -1926,7 +1926,7 @@
const char* item_text;
if (!items_getter(data, i, &item_text))
item_text = "*Unknown item*";
- if (Selectable(item_text, item_selected))
+ if (Selectable(item_text, item_selected) && *current_item != i)
{
value_changed = true;
*current_item = i;