Description

Calling SetIsEnabled on a UMG button in code will prevent any UMG input from being read (can't click other buttons/checkboxes, can't enter text into field, etc).

Regression:
No - code used does not compile in 4.14.3

Steps to Reproduce
  1. Open UE4 Editor (any project)
  2. Add code based on UserWidget (MyUserWidget)
  3. Add the following code to MyUserWidget.h
    • Add above .generated.h include:
      #include "Runtime/UMG/Public/Components/Button.h"
      
    • Add below GENERATED_BODY() line:
      public:
      	virtual void NativeConstruct();
      	UFUNCTION() void OnButtonClick();
      	UPROPERTY() UButton* Button;
      
  4. Add the following code to MyUserWidget.cpp
    void UMyUserWidget::NativeConstruct()
    {
    	Super::NativeConstruct();
    
    	Button = Cast<UButton>(GetWidgetFromName(TEXT("BP_Button")));
    	Button->OnPressed.AddDynamic(this, &UMyUserWidget::OnButtonClick);
    }
    
    void UMyUserWidget::OnButtonClick()
    {
    	Button->SetIsEnabled(false);
    }
    
  5. Compile
  6. Create blueprint based on MyUserWidget (MyWidgetBP)
  7. Add Canvas Panel to MyWidgetBP
  8. Add two buttons under Canvas Panel and rename one to BP_Button
  9. In level blueprint, add MyWidgetBP to the viewport
  10. PIE
  11. Click BP_Button

Result:
After clicking BP_Button, the other button does not react to being clicked

Expected:
BP_Button is disabled but other UMG elements are still active.

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

1
Login to Vote

Fixed
ComponentUE - Editor - UI Systems
Affects Versions4.15
Target Fix4.16
Fix Commit3356028
Main Commit3379345
CreatedMar 10, 2017
ResolvedMar 21, 2017
UpdatedApr 27, 2018