Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
softinvent-cto opened this issue Aug 16, 2024 · 5 comments · Fixed by #2568
Closed

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

softinvent-cto opened this issue Aug 16, 2024 · 5 comments · Fixed by #2568
Labels
status:in-progress Work is in progress

Comments

@softinvent-cto
Copy link

🐛 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

  • OS & Device: Windows 11
  • Browser: Microsoft Edge
  • .NET and Fluent UI Blazor library Version > 4.8.1
@microsoft-github-policy-service microsoft-github-policy-service bot added the triage New issue. Needs to be looked at label Aug 16, 2024
@vnbaaij
Copy link
Collaborator

vnbaaij commented Aug 21, 2024

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.

@vnbaaij vnbaaij closed this as completed Aug 21, 2024
@softinvent-cto
Copy link
Author

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
Copy link
Collaborator

vnbaaij commented Aug 21, 2024

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)

@vnbaaij vnbaaij reopened this Aug 21, 2024
@softinvent-cto
Copy link
Author

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
Copy link
Collaborator

vnbaaij commented Aug 22, 2024

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

@vnbaaij vnbaaij added status:in-progress Work is in progress and removed triage New issue. Needs to be looked at labels Aug 22, 2024
vnbaaij added a commit that referenced this issue Aug 22, 2024
* Fix #2542 by not including Instance.ontent in hash code method.

* Fix issue by adding Visible to DialogParameters. Dialog Hide/Show methods will now set Visible value. Provider will only render dialog if Visible is true.
dannyldj pushed a commit to dannyldj/fluentui-blazor that referenced this issue Sep 26, 2024
* Fix microsoft#2542 by not including Instance.ontent in hash code method.

* Fix issue by adding Visible to DialogParameters. Dialog Hide/Show methods will now set Visible value. Provider will only render dialog if Visible is true.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:in-progress Work is in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants