Strange behaviour of Enhanced input - need double clicking insted of single click

Hello, I’m getting strange behavior when using Enhanced input to detect pressing or releasing the left mouse button in the inventory.

The code below is supposed to make posible for player to drag items in inventory, when he left click on item.

When the inventory has no items in it everything works fine and enhanced input detects all left mouse button presses and releases. But when I add an item (asign actor of the item to ChildActorComponent) to the inventory enhanced input registers the press and release only for the first time, after that it has to be double clicked to register the press and process it.

Below is attached a video showing my problem and also other images, e.g. IA_LeftMBtn

thanks for any solutions
(If you need more info please ask)

video:

IA_LeftMBtn:

actor of the item:

code:

// Fill out your copyright notice in the Description page of Project Settings.

#include "Inventory.h"
#include "ItemInterface.h"
#include "EnhancedInputComponent.h"
#include "GameFramework/PlayerController.h"
#include "Engine/World.h"
#include "Engine/GameViewportClient.h"
#include "SceneView.h"
#include "Engine/Engine.h"
#include "EnhancedInputSubsystems.h"

AInventory::AInventory() : cPtr(nullptr), distance(0.0f)
{
	PrimaryActorTick.bCanEverTick = true;

	DefaultSceneRoot = CreateDefaultSubobject<USceneComponent>(TEXT("DefaultSceneRoot"));
	RootComponent = DefaultSceneRoot;

	boxesInv = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("boxesInv"));
	plane = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Plane"));

	camera = CreateDefaultSubobject<UCameraComponent>(TEXT("Camera"));

	spotLight = CreateDefaultSubobject<USpotLightComponent>(TEXT("spotLight"));

	flashlightActor = CreateDefaultSubobject<UChildActorComponent>(TEXT("FlashliteActor"));

	physicsHandle = CreateDefaultSubobject<UPhysicsHandleComponent>(TEXT("PhysicsHandle"));

	arrow1 = CreateDefaultSubobject<UArrowComponent>(TEXT("Arrow1"));

	boxesInv->SetupAttachment(RootComponent);
	plane->SetupAttachment(RootComponent);
	camera->SetupAttachment(RootComponent);
	camera->SetupAttachment(RootComponent);
	spotLight->SetupAttachment(RootComponent);
	arrow1->SetupAttachment(RootComponent);

	flashlightActor->SetupAttachment(boxesInv);
}

// Called when the game starts or when spawned
void AInventory::BeginPlay()
{
	Super::BeginPlay();

	localPlayer = GetWorld()->GetFirstLocalPlayerFromController();
	if (APlayerController* PC = GetWorld()->GetFirstPlayerController())
	{
		EnableInput(PC);
	}

	if (UEnhancedInputComponent* input = Cast<UEnhancedInputComponent>(InputComponent))
	{
		//input->BindAction(IA_LeftMBtn, ETriggerEvent::Started, this, &AInventory::LeftBtn);
		//input->BindAction(IA_LeftMBtn, ETriggerEvent::Completed, this, &AInventory::LeftBtnReleased);
		input->BindAction(IA_LeftMBtn, ETriggerEvent::Triggered, this, &AInventory::LeftBtn);
	}
}


void AInventory::LeftBtn(const FInputActionValue& Value)
{
	bool bPressed = Value.Get<bool>();
	UE_LOG(LogTemp, Warning, TEXT("AInventory::LeftBtn: running"));

	if (bPressed) {
		UE_LOG(LogTemp, Warning, TEXT("AInventory::LeftBtn: pressed"));
		FVector WorldPosition, WorldDirection;


		if (GetMousePos(WorldPosition, WorldDirection)) {
			FVector Start = WorldPosition;
			FVector End = Start + (WorldDirection * 10000.f);

			FHitResult HitResult;

			FCollisionQueryParams Params;
			Params.bTraceComplex = true;

			bool bHit = GetWorld()->LineTraceSingleByChannel(HitResult, Start, End, ECC_Visibility, Params);

			if (bHit && HitResult.GetActor())
			{
				if (HitResult.GetActor()->GetClass()->ImplementsInterface(UItemInterface::StaticClass())) {
					cPtr = HitResult.GetComponent();
					distance = HitResult.Distance;
					if (!cPtr->IsSimulatingPhysics()) {
						cPtr->SetSimulatePhysics(true);
					}
					physicsHandle->GrabComponentAtLocation(cPtr, HitResult.BoneName, HitResult.Location);
				}
				else {
					UE_LOG(LogTemp, Warning, TEXT("AInventory::LeftBtn: ImplementsInterface error"));
				}
			}
			else
			{
				UE_LOG(LogTemp, Warning, TEXT("AInventory::LeftBtn: Nothing hit under cursor"));
			}
		}
		else {
			UE_LOG(LogTemp, Warning, TEXT("AInventory::LeftBtn: GetMousePos Error"));
		}
	}
	else {
		UE_LOG(LogTemp, Warning, TEXT("AInventory::LeftBtn: released"));
		cPtr = nullptr;
		physicsHandle->ReleaseComponent();
	}
}

void AInventory::LeftBtnReleased(const FInputActionValue& Value)
{
	UE_LOG(LogTemp, Warning, TEXT("AInventory::LeftBtn: released"));
	cPtr = nullptr;
	physicsHandle->ReleaseComponent();
}

int AInventory::GetMousePos(FVector& WorldPosition,FVector& WorldDirection)
{
	UE_LOG(LogTemp, Warning, TEXT("Inventory (108): Getting GetMousePos"));

	if (localPlayer)
	{

		if (localPlayer->ViewportClient)
		{
			FVector2D ScreenPosition;
			localPlayer->ViewportClient->GetMousePosition(ScreenPosition);
			FSceneViewProjectionData ProjectionData;
			if (localPlayer->GetProjectionData(localPlayer->ViewportClient->Viewport, /*out*/ ProjectionData))
			{
				FMatrix const InvViewProjMatrix = ProjectionData.ComputeViewProjectionMatrix().InverseFast();
				FSceneView::DeprojectScreenToWorld(ScreenPosition, ProjectionData.GetConstrainedViewRect(), InvViewProjMatrix, /*out*/ WorldPosition, /*out*/ WorldDirection);
				return true;
			}
			else {
				UE_LOG(LogTemp, Warning, TEXT("Inventory (118): if localPlayer->GetProjectionData error"));
			}
		}
		else {
			UE_LOG(LogTemp, Warning, TEXT("Inventory (113): if localPlayer->ViewportClient error"));
		}
	}
	else
	{
		UE_LOG(LogTemp, Warning, TEXT("localPlayer je nullptr"));
		localPlayer = GetWorld()->GetFirstLocalPlayerFromController();
	}

	return false;
}

// Called every frame
void AInventory::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);
	if (IsValid(cPtr)) {
		FVector WorldPosition, WorldDirection;
		GetMousePos(WorldPosition, WorldDirection);
		FVector pos = WorldPosition + (WorldDirection * distance);

		physicsHandle->SetTargetLocation(pos);
	}
	else {
		//UE_LOG(LogTemp, Error, TEXT("Not Move"));
	}
}

void AInventory::UpdateItems(const TMap<int, int>& inv)
{
	UE_LOG(LogTemp, Error, TEXT("Update"));
	TArray<USceneComponent*> ChildrenComponents;
	boxesInv->GetChildrenComponents(true, ChildrenComponents);

	for (USceneComponent* Component : ChildrenComponents)
	{
		if (UChildActorComponent* ChildActorComponent = Cast<UChildActorComponent>(Component))
		{
			AActor* childActor = ChildActorComponent->GetChildActor();

			if (childActor && childActor->GetClass()->ImplementsInterface(UItemInterface::StaticClass())) {
				int id = IItemInterface::Execute_GetIDInf(childActor);

				const int* count = inv.Find(id);
				if (count) {
					IItemInterface::Execute_UpdateCountInf(childActor, *count);
					UE_LOG(LogTemp, Error, TEXT("count: %d"), *count);
					UE_LOG(LogTemp, Error, TEXT("id: %d"), id);
				}				
			}
		}
	}
	UE_LOG(LogTemp, Error, TEXT("Done"));
}


header:

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Camera/CameraComponent.h"
#include "Components/SpotLightComponent.h"
#include "Containers/Map.h"
#include "InputAction.h"
#include "InputActionValue.h"
#include "Engine/LocalPlayer.h"
#include "PhysicsEngine/PhysicsHandleComponent.h"
#include "Components/ArrowComponent.h"

#include "Inventory.generated.h"

UCLASS()
class NOXVIRIDUS_API AInventory : public AActor
{
	GENERATED_BODY()

public:
	// Sets default values for this actor's properties
	AInventory();

protected:
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;
	void LeftBtn(const FInputActionValue& Value);
	void LeftBtnReleased(const FInputActionValue& Value);
	int GetMousePos(FVector& WorldPosition, FVector& WorldDirection);

	//AActor* aPtr;
	UPrimitiveComponent* cPtr;
	const ULocalPlayer* localPlayer;
	float distance;

public:
	// Called every frame
	virtual void Tick(float DeltaTime) override;

	UPROPERTY(VisibleAnywhere, Category = "Components")
	USceneComponent* DefaultSceneRoot;

	UPROPERTY(EditAnywhere)
	class UStaticMeshComponent* boxesInv;

	UPROPERTY(EditAnywhere)
	class UStaticMeshComponent* plane;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	class UCameraComponent* camera;

	UPROPERTY(EditAnywhere)
	class USpotLightComponent* spotLight;
	UPROPERTY(EditAnywhere)
	class UPhysicsHandleComponent* physicsHandle;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Input")
	UInputAction* IA_LeftMBtn;

	//child actors
	UPROPERTY(EditAnywhere)
	class UChildActorComponent* flashlightActor;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	class UArrowComponent* arrow1;

	UFUNCTION(BlueprintCallable, Category = "Inventory")
	void UpdateItems(const TMap<int, int>& inv);
};

It was becouse of widget any ideas why?

my guess its it wasnt focused, so the first click focus and the second does the logic