Description

They've nailed it down to the following logic FUIActionBinding::TryCreate which doesn't check for the InputAction specified.

 // Make sure there is no existing binding for the same action associated with the same widget
   for (const TPair<FUIActionBindingHandle, TSharedPtr<FUIActionBinding>>& HandleBindingPair : AllRegistrationsByHandle)
   {
      if (HandleBindingPair.Value->ActionName == BindArgs.GetActionName() &&
         HandleBindingPair.Value->InputEvent == BindArgs.KeyEvent &&
         HandleBindingPair.Value->BoundWidget.Get() == &InBoundWidget)
      {
         UE_LOG(LogUIActionRouter, Error, TEXT("Widget [%s] is already bound to action [%s] [%s]! A given widget can only bind the same action once. Unregister existing binding first if you wish to change any aspect of the binding"),
            *InBoundWidget.GetName(), *HandleBindingPair.Value->ActionName.ToString(), InputEventToString(BindArgs.KeyEvent));
         return FUIActionBindingHandle();
      }
   }

 

Steps to Reproduce

UDN user was attempting to use Enhanced Input for Common UI but ran into an issue when registering a second UI binding. 

 

In NativeConstruct they're binding an additional action. This widget is a UCommonActivableWidget derivative with bIsBackHandler enabled (with an enhanced input action backing it).

   if (IsValid(CloseAction))
    {
        FBindUIActionArgs BindArgs(CloseAction, FSimpleDelegate::CreateUObject(this, &ThisClass::DeactivateWidget));
        BindArgs.bDisplayInActionBar = true;
 
        CloseActionHandle = RegisterUIActionBinding(BindArgs);
    }

 

Doing this will produce an error message in the log stating something like the following:

`LogUIActionRouter: Error: Widget [wbp_debug_menu_C_0] is already bound to action [None] [Pressed]! A given widget can only bind the same action once. Unregister existing binding first if you wish to change any aspect of the binding`

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-193679 in the post.

1
Login to Vote

Fixed
ComponentUE - Editor - UI Systems - UMG
Affects Versions5.2
Target Fix5.6
Fix Commit25214952
CreatedAug 23, 2023
ResolvedOct 11, 2024
UpdatedOct 11, 2024
View Jira Issue