diff --git a/src/app/core/labeling.cc b/src/app/core/labeling.cc index de30023f..492dcfb7 100644 --- a/src/app/core/labeling.cc +++ b/src/app/core/labeling.cc @@ -111,10 +111,10 @@ void ResourceLabelManager::SelectableLabelWithNameEdit( } if (ImGui::BeginPopupContextItem(label_id.c_str())) { - char* new_label = labels_[type][key].data(); - if (ImGui::InputText("##Label", new_label, labels_[type][key].size() + 1, + std::string* new_label = &labels_[type][key]; + if (ImGui::InputText("##Label", new_label, ImGuiInputTextFlags_EnterReturnsTrue)) { - labels_[type][key] = new_label; + labels_[type][key] = *new_label; } ImGui::EndPopup(); }