microsoft / fluentui-blazor

Microsoft Fluent UI Blazor components library. For use with ASP.NET Core Blazor applications
https://www.fluentui-blazor.net
MIT License
3.87k stars 376 forks source link

fix: Dialog.Hide() doesn't hide in DialogService/FluentDialog #2542

Closed softinvent-cto closed 2 months ago

softinvent-cto commented 3 months ago

πŸ› Bug Report

In our app, which resembles many of MS admin apps such as M365 admin, we use panels to display and gather primary data about an entity. For child entities we hide the primary panel and show a secondary panel to gather data for these, which has worked fine up to and including v4.8.1.

However, after upgrading to versions greater than 4.8.1 we experience that the primary panel isn't hidden, if data has been entered into it before the secondary panel is shown. If no data has been entered in the primary panel it is hidden correctly.

πŸ’» Repro or Code Sample

I've attached an example solution using dialogs where the error can be reproduced. If the project dependencies of the FluentUI components is set back to 4.8.1 the problem goes away.

FluentBlazorLayeredDialogs.zip

πŸ€” Expected Behavior

The dialog/panel should be hidden after a call to Dialog.Hide()

😯 Current Behavior

After v.4.8.1 the dialog/panel isn't hidden, if data has been entered into a field in the dialog.

🌍 Your Environment

vnbaaij commented 2 months ago

The changes we made after 4.8.1 are needed to be able to update the contents of an already shown dialog (see #2310). That change has apparently lead to your code being broken. We have stated a couple of times before though that nested dialogs are not supported. I'm afraid that means you need to alter your code as we can't undo the changes made.

softinvent-cto commented 2 months ago

So this means that it is not possible to use the FluentUI components to create designs like Microsoft does all over the place with nested panels, such as all their administration apps?

I understand that two panels/dialogs cannot be shown simultaneously, that's why we've used Dialog.Hide() to only show one panel at a time.

This change totally destroys our/MS design paradigm and throws away hundreds of hours of work. Not happy!

vnbaaij commented 2 months ago

The strange thing is it does work like you describe if you close the second dialog and then open that one again.

I'll reopen this and see if we can find a solution to make it work again. Will need some time though (until @dvoituron is back from vacation)

softinvent-cto commented 2 months ago

Phew, thanks Vincent, that will save a lot of work for us. No problem if it takes time, Denis deserves his vacation. Cheers :-) Henrik

vnbaaij commented 2 months ago

Ok, I found what is causing the issue. I just need to check if the solution can be implemented without having side-effects