I don’t know if this answer is outdated but the code below works for me
void SomeWidgetClass::Construct(const FArguments& args)
{
TSharedRef VertBox = SNew(SVerticalBox);
ChildSlot
[
VertBox
];
VertBox->AddSlot()
.AutoHeight()
[
+ SHorizontalBox::Slot()
.VAlign(VAlign_Center)
[
SNew(SEditableTextBox)
.OnTextCommitted(FOnTextCommitted::CreateSP(this, &SomeWidgetClass::SetUserName))
]
];
}
void SomeWidgetClass::SetUserName(const FText& NewText, ETextCommit::Type TextType)
{
//This will be called once the user presses enter when using a SEditableTextBox
}