danheron/Heron.MudCalendar

Inserting MudCalendar overrides <HeadContent>

Closed this issue · 2 comments

I have a dynamic application that relies on using HeadContent for dynamic meta and styling information. When inserting (with no parameters specified) onto a page, my dynamic HeadContent gets overwritten. I'm assuming this is because MudCalendar is using HeadContent to inject it's CSS/Scripts. HeadContent is not additive. The last call to HeadContent will always override what's in there previously.

To reproduce, create a page using
Add to the page
Notice that the HeadContent is overwritten.

Looking through the code, I notice that you are setting the HeadContent in MudCalendar.razor, line 12

    /// <summary>
    /// Renders the html page head element.
    /// </summary>
    protected virtual RenderFragment RenderHead =>
        @<HeadContent>
            @RenderHeaderContent
        </HeadContent>;

Could you add a parameter to make that declaration optional, knowing that the _Host.cshtml file would need to be updated with the CSS and Script manually?

I didn't realise that HeadContent will overwrite, I just assumed it would append. That's not good.

I will see if there is another way to do this. If not then I'll have to remove it.