Skip to content

Commit

Permalink
fix: get_value returning deleted value option for listbox #1640
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffstadt committed Apr 25, 2022
1 parent b7a54a8 commit dd79937
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions DearPyGui/src/ui/AppItems/mvBasicWidgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1150,6 +1150,25 @@ DearPyGui::set_configuration(PyObject* inDict, mvListboxConfig& outConfig, mvApp
}
index++;
}

if (!outConfig.value->empty())
{
if (!outConfig.names.empty())
{
bool oldValueFound = false;
for (int i = 0; i < outConfig.names.size(); i++)
{
if (outConfig.names[i] == *outConfig.value)
{
oldValueFound = true;
break;
}
}

if(!oldValueFound)
*outConfig.value = outConfig.names[0];
}
}
}

if(outConfig.value->empty())
Expand Down

0 comments on commit dd79937

Please # to comment.