1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-22 01:54:21 +00:00

Combo: Made simple/legacy Combo() function not returns true when picking already selected item. (#1182)

This commit is contained in:
ocornut 2023-06-28 15:47:10 +02:00
parent 6137443d24
commit a02315e1c4
3 changed files with 3 additions and 2 deletions

View file

@ -1926,7 +1926,7 @@ bool ImGui::Combo(const char* label, int* current_item, bool (*items_getter)(voi
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;