Even code in unreal has this problem. The UI Sequencer → Render Movie Settings → Burn in Options → Settings has this same issue when toggling between burn in classes in 4.21
I’ve been able to work around this by using a timer inside PostEditChangeProperty to update my uproperty. In my case, I null out the property in PostEditChangeProperty, then set a new value in the callback. It would be nice if there was some way to do this without a timer, as it feels like a hack.
Rough Example:
void UMyClass::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
{
FName PropertyName = (PropertyChangedEvent.Property != nullptr) ? PropertyChangedEvent.Property->GetFName() : NAME_None;
if (PropertyName == GET_MEMBER_NAME_CHECKED(UMyClass, MonitoredProperty))
{
if (OtherProperty != nullptr)
{
OtherProperty->Rename(*MakeUniqueObjectName(this, USettingsObject::StaticClass(), "Settings_EXPIRED").ToString());
OtherProperty->MarkPendingKill();
OtherProperty = nullptr;
}
if (GEditor)
{
FTimerHandle TimerHandle;
GEditor->GetTimerManager()->SetTimer(
TimerHandle,
this,
&UMyClass::UpdateSettings,
0.01f,
false);
}
}
Super::PostEditChangeProperty(PropertyChangedEvent);
}
void UMyClass::UpdateSettings()
{
OtherProperty = NewObject<USettingsObject>();
}