UEditableTextBox
#include "Components/EditableTextBox.h" Description
A single-line text input widget. Exposes OnTextChanged and OnTextCommitted delegates. Use GetText()/SetText() to read and write content.
Signature
class UEditableTextBox : public UWidget Caveats & Gotchas
- • Single-line only — use UMultiLineEditableTextBox for multi-line input.
- • Direct property access for Text and HintText was deprecated in UE 5.1. Use getter/setter functions.
- • OnTextCommitted fires when the user presses Enter or when the widget loses focus — check the ETextCommit::Type parameter to distinguish between the two.
- • Keyboard input on console/mobile requires explicit focus. Call SetFocus() or use a WidgetFocusPath to bring up the virtual keyboard.
Example
Read input on commit C++
// Bind in NativeConstruct:
PlayerNameInput->OnTextCommitted.AddDynamic(this, &UMyWidget::OnNameCommitted);
void UMyWidget::OnNameCommitted(const FText& Text, ETextCommit::Type CommitMethod)
{
if (CommitMethod == ETextCommit::OnEnter)
{
FString Name = Text.ToString();
// Use Name...
}
} See Also
Version History
Introduced in: 4.5
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?