From fff1dc584ff73405f2f0eaa9336d5bfc5b73a69e Mon Sep 17 00:00:00 2001 From: GhostofCookie Date: Mon, 6 Jan 2025 16:21:05 -0500 Subject: [PATCH] Fix port input field default not actually setting the port. --- src/views/PortView.cpp | 4 ++-- src/widgets/InputField.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/views/PortView.cpp b/src/views/PortView.cpp index 6bdba8d..f1e68b4 100644 --- a/src/views/PortView.cpp +++ b/src/views/PortView.cpp @@ -77,6 +77,8 @@ void PortView::Draw() ImGui::PopStyleVar(); } + _builder->EndInput(); + if (ImGui::IsItemActive() && !_was_active) { ed::EnableShortcuts(false); @@ -87,8 +89,6 @@ void PortView::Draw() ed::EnableShortcuts(true); _was_active = false; } - - _builder->EndInput(); } else if (Kind == PortType::Output) { diff --git a/src/widgets/InputField.cpp b/src/widgets/InputField.cpp index 97dc901..e541841 100644 --- a/src/widgets/InputField.cpp +++ b/src/widgets/InputField.cpp @@ -6,7 +6,8 @@ FLOW_UI_SUBNAMESPACE_START(widgets) template -Input::Input(std::string name, const T& initial_value) : _name{std::move(name)}, _value{initial_value} +Input::Input(std::string name, const T& initial_value) + : _name{std::move(name)}, _value{initial_value}, _data{MakeNodeData(_value)} { }