Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Jonas Otto <[email protected]>
  • Loading branch information
authaldo and ottojo authored Aug 6, 2023
1 parent 49b82bd commit 4339273
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/rig_reconfigure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ std::set<ImGuiID> visualizeParameters(ServiceWrapper &serviceWrapper,
std::make_shared<ParameterModificationRequest>(ROSParameter(fullPath, value)));
}
} else if (std::holds_alternative<std::string>(value)) {
// Set to true when enter is pressed
bool flush = false;

// Note: ImGui provides an option to provide only callbacks on enter, but we additionally need the
Expand All @@ -520,6 +521,7 @@ std::set<ImGuiID> visualizeParameters(ServiceWrapper &serviceWrapper,
}
}

// Second condition: InputText focus lost
if (flush || (!ImGui::IsItemActive() && dirtyTextInput == fullPath)) {
dirtyTextInput.clear();
serviceWrapper.pushRequest(
Expand Down

0 comments on commit 4339273

Please sign in to comment.