From 42c52b324dfd7a320c3de8944b120819f4acc8f9 Mon Sep 17 00:00:00 2001 From: Jaidyn Ann Date: Wed, 18 Aug 2021 11:27:14 -0500 Subject: [PATCH] (libinterface) Automatically clear text in EnterTextView --- libs/libinterface/EnterTextView.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/libinterface/EnterTextView.cpp b/libs/libinterface/EnterTextView.cpp index 75792bd..9c5a863 100644 --- a/libs/libinterface/EnterTextView.cpp +++ b/libs/libinterface/EnterTextView.cpp @@ -33,8 +33,11 @@ EnterTextView::KeyDown(const char* bytes, int32 numBytes) if (fTarget != NULL && (bytes[0] == B_ENTER) && (modifiers == 0)) { BMessage* msg = new BMessage(fMessage); - if (fTextSlot.IsEmpty() == false) + if (fTextSlot.IsEmpty() == false) { msg->AddString(fTextSlot.String(), Text()); + SetText(""); + ScrollToOffset(0); + } fTarget->MessageReceived(msg); } else