With CommonUI and EnhancedInput enabled, how can I properly use InputActions with Started and Competed events?

Without CommonUI, I can directly use an EnhancedInputAction in the widget blueprint with its Started, Completed etc. events firing off when expected.

However, with CommonUI input routing this is no longer possible. I’ve created a custom c++ class derived from UCommonActivatableWidget and added some functions to register input bindings

void UExtendedCommonActivatableWidget::RegisterBinding(UInputAction* InputAction, const FInputActionExecutedDelegate& Callback, FUIActionBindingHandle& BindingHandle)
{
FBindUIActionArgs BindArgs(InputAction, FSimpleDelegate::CreateLambda(InputAction, Callback
{
Callback.ExecuteIfBound(InputAction);
}));
BindArgs.bDisplayInActionBar = false;

BindingHandle = RegisterUIActionBinding(BindArgs);
BindingHandles.Add(BindingHandle);
} 

and I’ve created a non-generic data asset derived from CommonMappingContextMetadata, and set up the input actions to be non-generic. Now when I register a non-generic input action in a widget blueprint, and I can add the input action node

but the issue is, when I press the respective key, Started and Triggered are fired off immediately as expected, but Completed fires off automatically on the next frame, and not when I release the key.

Is there a way to fix this? Am I doing something wrong with binding registration?
Thank you in advance!

I found a solution.

UExtendedCommonActivatableWidget.h (derived from UCommonActivatableWidget):

    UPROPERTY(Transient)
    TObjectPtr<UEnhancedInputComponent> WidgetInputComponent = nullptr;

UExtendedCommonActivatableWidget.cpp:

void UExtendedCommonActivatableWidget::NativeConstruct()
{
    Super::NativeConstruct();
    if (!WidgetInputComponent)
    {
       WidgetInputComponent = NewObject<UEnhancedInputComponent>(this, TEXT("WidgetInputComponent"));
       WidgetInputComponent->RegisterComponent();
    }
}

void UExtendedCommonActivatableWidget::NativeDestruct()
{
    if (WidgetInputComponent)
    {
       WidgetInputComponent->UnregisterComponent();
    }
    Super::NativeDestruct();
}

void UExtendedCommonActivatableWidget::NativeOnActivated()
{
    Super::NativeOnActivated();
    if (APlayerController* PC = GetOwningPlayer())
    {
       if (WidgetInputComponent)
       {
          PC->PushInputComponent(WidgetInputComponent);
       }
    }
}

void UExtendedCommonActivatableWidget::NativeOnDeactivated()
{
    if (APlayerController* PC = GetOwningPlayer())
    {
       if (WidgetInputComponent)
       {
          PC->PopInputComponent(WidgetInputComponent);
       }
    }
    Super::NativeOnDeactivated();
}

After you do this, you can use any EnhancedInputAction in the widget blueprint and its events will fire off when you expect them to, Started on press, Triggered every tick while held, Completed on Release.

Addition: inGetDesiredInputConfi, InputModeshould be set toAll for it to work