Closed emetrix closed 7 months ago
Hi Tobi,
See the example at https://www.fluentui-blazor.net/Dialog#customizeddialog for a dialog that cannot be closed/dismissed by using the 'Esc' key. I'm assuming this works for a Splash Screen as well (but not 100% sure).
Please test and let us know. Danke!
Hi Vincent, thank you for your feedback. All dialog samples except Customized Dialog and Editable Dialog closes when the Esc key is pressed. But I can't see why the behaviour differs in the samples - or how to modiy it ?
My first guess would be it is because of PreventDismissOnOverlayClick
being set. I would need to look at the code to be sure. But not doing that now. Enjoying the ☀ for a bit!
Just tried PreventDismissOnOverlayClick
: For the SplashScreen I can see no difference at setting this to true or false ?
private async Task ShowLoadScreenAsync()
{
parameters = new()
{
DialogType = DialogType.SplashScreen,
PreventDismissOnOverlayClick = true,
Content = new()
{
DisplayTime = 0,
LoadingText = "Loading data..."
},
Width = "300px",
Height = "110px"
};
_dialog = await DialogService.ShowSplashScreenAsync<CustomLoadScreen>(parameters);
}
Looking at this some more. Have not found the difference between this and the custom dialog yet either
We could add an option to prevent the user from closing the SplashScreen, but I don't find it disturbing that, by default, the ESC key can do this. This is also available in Office applications.
I would be thankful if you could implement such an option/feature. In case of a splashscreen indicating a (long) running task closing the screen would lead to a white/blank screen until the task is finished - which I think would irritate users.
I agree. That could be an interesting feature.
I would be thankful if you could implement such an option/feature. In case of a splashscreen indicating a (long) running task closing the screen would lead to a white/blank screen until the task is finished - which I think would irritate users.
So there is a switch for it already: PreventDismissOnOverlayClick
It just wasn't used in the actual ialog calling function yet. With the fix from Denis this works now as expected.
Thank you so much for your fast help and this awesome project in general !!!
🐛 Bug Report
SplashScreen is closable by pressing ESC key.
💻 Repro or Code Sample
The behaviour is reproducable in demo site: https://www.fluentui-blazor.net/SplashScreen or in the sample at https://github.com/emetrix/Samples.BlazorFluentUI-Splashscreen
🤔 Expected Behavior
A splashscreen for e.g. indicating long running tasks should not be closable by the user.
😯 Current Behavior
The SplashScreen closes when the Escape key is pressed by the user.
💁 Possible Solution
ignoring ESC or all key presses while a splashscreen is displayed ?
🔦 Context
I try to use a custom splashscreen during calculations and data access operations. Therefore the dialog should not be closable by the users.
🌍 Your Environment