flet icon indicating copy to clipboard operation
flet copied to clipboard

AlertDialog.modal documentation unclear

Open NathanCummings opened this issue 1 year ago • 2 comments

The documentation for AlertDialog.modal says:

modal

Whether dialog can be dismissed/closed by clicking the area outside of it.

Value is of type bool and defaults to False.

So I assumed that setting it to True would allow the AlertDialog to be dismissed/closed by clicking the area outside of it, however, the opposite appears to be the case.

No big deal, but it took me longer than I care to admit to figure out what was happening 😂

NathanCummings avatar Feb 02 '25 11:02 NathanCummings

When u set the modal method to True, you can only dismiss the dialog on an event which is sometimes not the case on Android where the back button can also dismiss the dialog even if modal attribute was set to True.

When modal is set to False, that literally means by a mere clicking on the barrier background, the dialog is dismissed without even an event.

HappyCoder256 avatar Feb 02 '25 21:02 HappyCoder256

When u set the modal method to True, you can only dismiss the dialog on an event which is sometimes not the case on Android where the back button can also dismiss the dialog even if modal attribute was set to True.

When modal is set to False, that literally means by a mere clicking on the barrier background, the dialog is dismissed without even an event.

Yep, understood. I suggest the docs could make this more clear.

NathanCummings avatar Feb 03 '25 10:02 NathanCummings