-
-
Notifications
You must be signed in to change notification settings - Fork 11.7k
If multiple InputText's are created via loop, whenever I select one when running my app, it deselects it. #4395
Copy link
Copy link
Closed
Labels
label/id and id stackimplicit identifiers, pushid(), id stackimplicit identifiers, pushid(), id stack
Description
Version: 1.83
Branch: docking
My Issue/Question: If multiple InputText's are created via loop, whenever I select one when running my app, it deselects it.
I've been creating a game engine in Vulkan, and the UI with imgui, but as I started to make my entity inspector, it seems when I create input text via looping, whenever I select an input, it deselects it, and if I select the input that was the last one created, it selects all of them and i can edit the text in all of the inputs.
Here's the code of what I have:
for (int i = 0; i < storage.sel_gameEntities.size(); i++) {
std::string s = std::to_string(storage.sel_gameEntities[i][0]->getId());
if (ImGui::CollapsingHeader(std::string(std::string(storage.sel_gameEntities[i][0]->name) + "###" + s).c_str(), ImGuiTreeNodeFlags_None))
{
ImGui::InputText("Name", storage.sel_gameEntities[i][0]->buf_name, 64);
storage.sel_gameEntities[i][0]->name = storage.sel_gameEntities[i][0]->buf_name;
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
label/id and id stackimplicit identifiers, pushid(), id stackimplicit identifiers, pushid(), id stack