MudBlazor.Extensions icon indicating copy to clipboard operation
MudBlazor.Extensions copied to clipboard

Not working

Open mihaimyh opened this issue 4 years ago • 13 comments

I followed the readme trying to use the dialog extensions but I cannot get it to work. Should I also add your js and css files in my _Host.cshtml / index.html?

mihaimyh avatar Jul 26 '22 16:07 mihaimyh

You can but this is not required. If not loaded styles and js will automatically loaded. You need to use die extension method ShowEx for the IDialogService

var optionsEx = new DialogOptionsEx
        {
            CloseButton = true,
            MaxWidth = MaxWidth.Medium,
            FullWidth = true,
            DisableBackdropClick = true,
            MaximizeButton = true,
            DragMode = MudDialogDragMode.Simple,
            Position = await PositionBasedOnMouse(),
            Animations = new []{AnimationType.SlideIn},
            FullHeight = true,
            DisableSizeMarginY = true,
            DisablePositionMargin = true
        };
 
        return await dialogService.ShowEx<TDialog>(title, parameters, optionsEx);

However if loading of styles or js is your problem you can try to add them manually in your index.html

<script src="/_content/MudBlazor.Extensions/mudBlazorExtensions.js"></script>
<link href="/_content/MudBlazor.Extensions/mudBlazorExtensions.min.css" rel="stylesheet" />

fgilde avatar Jul 28 '22 12:07 fgilde

Hope this helps if not let me know

fgilde avatar Jul 28 '22 21:07 fgilde

Still doesn't work, I don't see a maximize button, nor the animations.

image

image

mihaimyh avatar Jul 29 '22 23:07 mihaimyh

Please pass the option for jsruntime as well then it should work

fgilde avatar Jul 30 '22 00:07 fgilde

Works now?

fgilde avatar Aug 01 '22 11:08 fgilde

I changed it with this one, but no luck, still not working:

    var optionsEx = new DialogOptionsEx
    {
        CloseButton = true,
        MaxWidth = MaxWidth.False,
        FullWidth = true,
        DisableBackdropClick = true,
        MaximizeButton = true,
        DragMode = MudDialogDragMode.Simple,
        Animations = new[] { AnimationType.Bounce },
        FullHeight = true,
        DisableSizeMarginY = true,
        DisablePositionMargin = true,
        Resizeable = true,
        JsRuntime = JsRuntime
    };

var dialog = await DialogService.ShowEx<JobRunLogDialog>("Job Log", parameters, optionsEx);

mihaimyh avatar Aug 02 '22 20:08 mihaimyh

Ok that's strange. Do you have any errors in browser console? If you want we can also have a look on it together with teams or you share your repo.

fgilde avatar Aug 04 '22 09:08 fgilde

Having the same issue here

falsharif86 avatar Aug 09 '22 09:08 falsharif86

Worked by passing in Jsruntime

falsharif86 avatar Aug 09 '22 09:08 falsharif86

It now works for me also by injecting JsRuntime, but there seems to be issues when a displaying a dialog on top of another dialog. The buttons of the last (child) dialog are not visible.

mihaimyh avatar Aug 11 '22 15:08 mihaimyh

It seems the buttons of the child dialogs are on the same line with the parent dialog buttons

image

mihaimyh avatar Aug 11 '22 15:08 mihaimyh

I will check

fgilde avatar Aug 12 '22 11:08 fgilde

This bug is solved in 1.4.2

fgilde avatar Aug 30 '22 16:08 fgilde