Description

Customizations that use FDetailPropertyRow::CustomWidget and set the visibility attribute do not honor it. A Customization set up like the below, for instance, will not honor the Visibility in red due to it being a CustomWidget. The reason is that things that make their widgets this way are not added to the tickable nodes to have the visibility refreshed.

    IDetailPropertyRow& ComplexFieldDetailPropertyRow = StructBuilder.AddProperty(ComplexFieldPropertyHandle);
        ComplexFieldDetailPropertyRow.GetDefaultWidgets(ComplexFieldNameWidget, ComplexFieldValueWidget);
 
        ComplexFieldDetailPropertyRow
        .CustomWidget()
        // <DOESN'T WORK>
        .Visibility(TAttribute<EVisibility>(this, &FMyStructCustomization::GetFieldVisibilityFailing))
        .NameContent()
        [
            ComplexFieldNameWidget.ToSharedRef()
        ]
        .ValueContent()
        [
            ComplexFieldValueWidget.ToSharedRef()
        ];    

 

Steps to Reproduce
  1. Replace your local Engine/Source/Editor/UnrealEd/Classes/Editor/PropertyEditorTestObject.h file with the one provided here.
  2. In E:\Perforce\UE5_Main_E_3\Engine\Source\Editor\UnrealEd\Private\UnrealEdEngine.cpp
    1. in the method void UUnrealEdEngine::Init(IEngineLoop* InEngineLoop) method add the following line: PropertyModule.RegisterCustomPropertyTypeLayout("MyStruct", FOnGetPropertyTypeCustomizationInstance::CreateStatic(&FMyStructCustomization::MakeInstance));
    2. And include: 
      #include "Editor/PropertyEditorTestObject.h"
  3. Launch the editor
  4. Invoke the console command testprops command
  5. Notice that ComplexField row is showing ~ it should not be because the visibility should be collapsed when there is nothing in Simple field.

Generally speaking, each time you tab out of the simple field, ComplexField row should be showing if and only if there is text in the Simple Field text box (see gif)

 

Have Comments or More Details?

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

0
Login to Vote

Fixed
ComponentUE - Editor - Workflow Systems
Affects Versions5.3
Target Fix5.4
Fix Commit29528182
Main Commit29531220
CreatedOct 31, 2023
ResolvedNov 8, 2023
UpdatedFeb 1, 2024
View Jira Issue