If you have a Slate widget which can receive focus, but you want one of its children to automatically receive focus instead, you can override OnFocusReceived
.
FReply SZEASearchWindow::OnFocusReceived(const FGeometry& MyGeometry, const FFocusEvent& InFocusEvent)
{
return SearchBox->OnFocusReceived(MyGeometry, InFocusEvent);
}
In the above example, when a SZEASearchWindow
receives focus, it will automatically focus its child widget SearchBox
.