ThemeManager icon indicating copy to clipboard operation
ThemeManager copied to clipboard

Color pickers not working

Open Alipoustdouzan opened this issue 4 years ago • 6 comments

When i try to change colors in color pickers or change the RGB textbox, It doesn't change the color, Other settings work except colors. My NuGet versions :

image

Alipoustdouzan avatar Jan 14 '22 20:01 Alipoustdouzan

I'm facing same issue, but just when using client side blazor, otherwise is working correclty.

pesik77 avatar Jan 20 '22 07:01 pesik77

I am facing the same !!

Logi-Fy-Pravin avatar Jan 31 '22 16:01 Logi-Fy-Pravin

yes.im facing the same prob

hastiiFallah avatar Feb 01 '22 00:02 hastiiFallah

I'm facing same issue, but just when using client side blazor, otherwise is working correclty.

I created a Blazor Serverside project but still have this issue, Only for colors.

Alipoustdouzan avatar Feb 02 '22 17:02 Alipoustdouzan

Same here, the picker shows up but it's not working.

Medioman92 avatar Feb 07 '22 08:02 Medioman92

Check that the MudDialogProvider is exist only one time either in the App or in the Main Layout.

`#####################################################################
App.razor
###############################################################################
<MudThemeProvider Theme="@mudTheme" />
<MudDialogProvider />
<MudSnackbarProvider />

<CascadingValue Value="this">
<Router ...>
...
</Router>
</CascadingValue>

@code
{
    public EventCallback<MudTheme> ThemChanged;

    public MudTheme mudTheme = new MudTheme()
    {
        Palette = new Palette()
        {
            Primary = "#5D2E8F",
            AppbarBackground = "#5D2E8F",
        }
    };

    public App()
    {
       // Needs for autocalling StateHasChanged and changing to MUI theme.
        ThemChanged = new EventCallbackFactory().Create<MudTheme>(this, (e) => { mudTheme = e; });
    }
}
###############################################################################
MainLayout.razor
###############################################################################
    <MudLayout>
        <MudAppBar Elevation="2">
...
            <div class="d-none d-md-flex align-center">
                <MudSelect Class="mx-4"
                           Dense="true"
                           Label="Theme Manager Config"
                           Style="max-width: 250px; color: #fff;"
                           T="string"
                           Value="_themeManagerConfiguration.Key"
                           ValueChanged="ThemeManagerConfigChanged">
                    @foreach (var config in _themeManagerConfigurations)
                    {
                        <MudSelectItem T="string"
                                       Value="config.Key" />
                    }
                </MudSelect>
            </div>
        </MudAppBar>
...
        <MudThemeManager @bind-Open="_themeManagerOpen"
                    @bind-Theme="mudTheme"
                    Configuration="_themeManagerConfiguration.Value" />
        <MudThemeManagerButton OnClick="@(e => _themeManagerOpen = true)" />

        <MudMainContent Style="min-height: 100vh; display: flex; flex-direction: column">
            <MudContainer MaxWidth="MaxWidth.False" Style="flex: 1">
...
    </MudLayout>

@code {
    [CascadingParameter] App App { get; set; }

    protected readonly Dictionary<string, ThemeManagerConfiguration> _themeManagerConfigurations = new()
    {
        {"Preset One", ThemeManagerPresetConfigurations.GetPresetConfigOne()},
        {"Preset Two", ThemeManagerPresetConfigurations.GetPresetConfigTwo()}
    };

    public MudTheme mudTheme 
    {
        get => App.mudTheme;
        set { App.ThemChanged.InvokeAsync(value); }
    } 
    
    protected KeyValuePair<string, ThemeManagerConfiguration> _themeManagerConfiguration;

    protected bool _drawerOpen;
    protected bool _themeManagerOpen;

    protected void ThemeManagerConfigChanged(string key)
    {
        _themeManagerConfiguration = _themeManagerConfigurations.FirstOrDefault(x => x.Key == key);
    }

}`

AnikeRU avatar Jun 16 '22 12:06 AnikeRU