[Bug Version 4.23.2] Dialog renders twice

Hi,
Version 4.23.2 introduces a Bug to the RadzenDialog thats causes

    protected override async Task OnAfterRenderAsync(bool firstRender)
    {
        if (firstRender)
        {
          IGetExecutedTwice();
        }
    }

to be triggered twice with firstRender=true.
Maybe this is related to the "Dialog will stop render during drag."-Fix.

Thanks for investigating!

Hi @USBStick,

I don't understand your report - can you replicate the problem here?

Sorry for not being clear.
Unfortunately I can not replicate the problem on the demo page, because I need to modify the Dialog-component and not the compoment opening the Dialog.
But to replicate the issue just add this to any Dialog-component in Version 4.23.2:
int i = 0;
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
i = i++;
}
}

You will see that when the Dialog is completly loaded i=2 while normally it should be 1.
Hope that clears it up.

I'm afraid I still don't understand. Our demos are editable, you can apply whatever modification you want and press run button.

Let's look at the first example "Open page as a dialog":
The DialogService opens the "DialogCardPage". To replicate the issue I would need to edit this "DialogCardPage".
If you add
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
...
}
}
to "DialogCardPage" and replace "..." you should notice that whatever you execute there will be executed twice because "OnAfterRenderAsync" gets triggerd at least twice and bool firstRender is true 2 times while it must only be true 1 time.

When I run the demos locally the render is hit only once:
dialog-render

I am very sorry to have wasted your time...

I initially updated the NuGet-package to 4.23.2 and the described problem appeared.
I then downgraded to 4.23.1 and the problem was gone.
I opened this topic and after your last reply I confirmed this by running the local demo and it also worked fine.
I now updated the NuGet-package to 4.23.2 again and the problem did not reappear.

I don't know what caused this as I did not alter my code at all, but I am happy it works now.

Thanks for helping!

I have the same problem in the Dialog Renders twice


in the blazor Server with version [4.26.1]. I use the foreach loop to go through a list of reference. Would you please let me know to fix the problem. Thanks!