fluentui-blazor icon indicating copy to clipboard operation
fluentui-blazor copied to clipboard

fix: Modal=false behaviour in FluentDialog

Open Maintenance-Partnership-Systems opened this issue 1 year ago β€’ 5 comments

πŸ› Bug Report

If you set Modal=false in a FluentDialog, you still cannot interact with any controls or components outside of the dialog.

πŸ’» Repro or Code Sample

See the first example at https://www.fluentui-blazor.net/Dialog. Clear the Modal and Trap Focus checkboxes and display the dialog.

πŸ€” Expected Behavior

If "Modal=false", you should be able to interact with all other controls and components on the page; same as the behaviour of a non-modal dialog in a desktop application.

😯 Current Behavior

You cannot interact with anything else on the page except the dialog.

πŸ”¦ Context

The use-case where I encountered this was: displaying a side-bar of usage hints in an editor page. I wanted the user to be able to leave the sidebar up as reference while using the editor. I expected DialogService.ShowPanelAsync() to do this for me. I will probably have to re-implement the help panel as a hidden div within the editor page instead.

🌍 Your Environment

Windows 11, ASP.NET 8.0 WebAssembly application. FluentUI 4.10.2 Chrome Version 131.0.6778.140

When 'Modal' is checked, the dialog can be dismissed by clicking outside of the dialog.

You can't use a dialog to display content while still allowing you to manipulate elements in the β€œlayer” below. And from an ergonomic point of view, I don't think this is a good idea.

dvoituron avatar Dec 17 '24 08:12 dvoituron

Can we all agree that 'Modal = true' should mean you should not be able to interact outside of the dialog? Also, can we all agree that 'Modal = false' should mean you if you click outside of the dialog it should close.

Currently with the latest version 4.12.1 Modal = true displays a shaded background over all the content. And if you click off the dialog it closes. Modal = false is not shaded and does prevent the user from clicking outside of the dialog, it does not close when clicking off.

This current behavior is unexpected and wrong.

My expectation is that when Modal = true that background would be shaded and clicking off would prevent you from closing.

With the current implementation. I can't get the shading and prevent the user from clicking off, closing the dialog.

"Modal = false" acts as more modal like (every other application on earth that implements Modal), but sure would be nice to have the background shaded.

This ticket should be reopened.

scheatham-citadel avatar Aug 28 '25 20:08 scheatham-citadel

I think we can agree on that but it is not how the underlying web component works unfortunately (think that was an error on their side).

Because of that and because we can't just change (break) our current API, this will not get changed until we do our next major version (v5), which we are currently working on (no ETA!).

vnbaaij avatar Aug 28 '25 21:08 vnbaaij

We have already changed this behavior in version v5. https://fluentui-blazor-v5.azurewebsites.net/Drawer

dvoituron avatar Aug 29 '25 08:08 dvoituron

https://fluentui-blazor-v5.azurewebsites.net/Dialog Open Dialog in version 5 is working as expected.

scheatham-citadel avatar Aug 29 '25 17:08 scheatham-citadel