Giter Club home page Giter Club logo

Comments (6)

Anu6is avatar Anu6is commented on May 24, 2024 1

<CascadingValue Value=false Name="UsePopoverProvider"> -- this is your problem.

Why are you setting UsePopoverProvider to false? You should only need that if you are already registering a PopoverProvider somewhere else in your code. It's usually registered within the MudThemeProvider, but your telling the MudThemeProvider to not register it.

Also, if that's all your class does, there is no real need to make your own class, you just need to define your custom MudTheme and do <MudThemeProvider Theme="MyTheme" IsDarkMode="true"/>

from mudblazor.

andreaswto avatar andreaswto commented on May 24, 2024 1

@Anu6is This was probably a copy paste error on my part. I have removed this and now it works without any problems. Many thanks for your support.

from mudblazor.

Anu6is avatar Anu6is commented on May 24, 2024

You are most likely missing something in your setup. Since you've stated that you added the render modes globally, the next possible issues is missing the mud providers in your main layout.

from mudblazor.

andreaswto avatar andreaswto commented on May 24, 2024

@Anu6is Yes, I have declared the two lines <MudThemeProvider/> and <MudDialogProvider/> in the MainLayout.razor.

from mudblazor.

Anu6is avatar Anu6is commented on May 24, 2024

Can you share a repo link reproducing the issue?

from mudblazor.

andreaswto avatar andreaswto commented on May 24, 2024

@Anu6is I have tried to create a separate project and reproduce the problem. However, the component works there without any problems. Unfortunately, I cannot publish my code.

I have now found out that the source of the problem is with my costum ThemeProvider. It is structured like this:

<CascadingValue Value=false Name="UsePopoverProvider">
<MudThemeProvider Theme="MyTheme" IsDarkMode="true"></MudThemeProvider>
</CascadingValue>

@code {
public static MudTheme MyTheme => new()
{
PaletteDark = new PaletteDark()
{
Primary = "#e30613",
AppbarBackground = "#1a1e21",
Background = "#1a1e21",
TextPrimary = "#e2e2e2",
Secondary = "#039136",
Black = "#151521",
Dark = "#151521",
Tertiary = "#95a5a6",
},
Typography = new Typography()
{
Default = new Default()
{
FontFamily = new[] { "Roboto", "Verdana", "Geneva"}
},
Button = new Button()
{
TextTransform = "None",
FontSize = "0.85rem"
}
}
};
}

I have the following references in the MainLayout:

<MyMudThemeProvider /> (is like the name of the class)
<MudDialogProvider />
<MudSnackbarProvider />

If I reference the standard <MudThemeProvider/>, the components work.
Do you have any idea what is wrong here?

from mudblazor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.