[CommonUI] Issue with SetFocus and CommonButtonBase Slate button

I spent a day looking into this same problem. I found something that works, but requires editing the CommonUI plugin code.

Simply add these to CommonButtonBase.h/cpp:

COMMONUI_API TSharedPtr<SButton> GetSlateButton() const;

UFUNCTION(BlueprintCallable, Category = "Common Button")
COMMONUI_API void SetFocusOnRootButton();

cpp file:

TSharedPtr<SButton> UCommonButtonInternalBase::GetSlateButton() const
{
return MyCommonButton;
}

void UCommonButtonBase::SetFocusOnRootButton()
{
FSlateApplication::Get().SetKeyboardFocus(RootButton->GetSlateButton());
}

Then call SetFocusOnRootButton on your CommonButtonBase instead of SetFocus.
If there’s some way to retrieve the Slate button from UMG then you could get around having to modify the plugin. Not sure how to do that though.