ThemeManager icon indicating copy to clipboard operation
ThemeManager copied to clipboard

Color picker keep show up

Open kamazheng opened this issue 1 year ago • 12 comments

The color picker not hidden after color selected: (.Net 8)

@using MudBlazor.ThemeManager
@inherits LayoutComponentBase

<MudThemeProvider Theme="_themeManager.Theme" />
<MudDialogProvider />
<MudSnackbarProvider />
<MudThemeManagerButton OnClick="@((e) => OpenThemeManager(true))" />
<MudThemeManager Open="_themeManagerOpen" OpenChanged="OpenThemeManager" Theme="_themeManager" ThemeChanged="UpdateTheme" />
<MudDrawer @bind-Open="_themeManagerOpen" ClipMode="_themeManager.DrawerClipMode" Elevation="_themeManager.DrawerElevation"></MudDrawer>

<MudLayout>
    <MudAppBar Elevation="_themeManager.AppBarElevation">
        <MudIconButton Icon="@Icons.Material.Filled.Menu" Color="Color.Inherit" Edge="Edge.Start" OnClick="@((e) => DrawerToggle())" />
        <MudText Typo="Typo.h5" Class="ml-3">Application</MudText>
        <MudSpacer />
        <MudIconButton Icon="@Icons.Material.Filled.MoreVert" Color="Color.Inherit" Edge="Edge.End"/>
    </MudAppBar>
    <MudDrawer @bind-Open="_drawerOpen" ClipMode="DrawerClipMode.Always" Elevation="2">
        <NavMenu />
    </MudDrawer>
    <MudMainContent Class="mt-16 pa-4">
        @Body
    </MudMainContent>
</MudLayout>



@code {

    private ThemeManagerTheme _themeManager = new ThemeManagerTheme();
    public bool _themeManagerOpen = false;

    void OpenThemeManager(bool value)
    {
        _themeManagerOpen = value;
    }

    void UpdateTheme(ThemeManagerTheme value)
    {
        _themeManager = value;
        StateHasChanged();
    }

    protected override void OnInitialized()
    {
        StateHasChanged();
    }

    private bool _drawerOpen = true;

    private void DrawerToggle()
    {
        _drawerOpen = !_drawerOpen;
    }
}

image

kamazheng avatar Mar 26 '24 19:03 kamazheng

same problem,did you solve that problem?

ikingsbear avatar Apr 12 '24 15:04 ikingsbear

Same issue here, Net .7 on WebAssembly project.

Lonnewolf46 avatar Apr 20 '24 01:04 Lonnewolf46

收到你的Email了

ikingsbear avatar Apr 20 '24 01:04 ikingsbear

收到你的Email了

Please communicate in English, thanks.

henon avatar Apr 20 '24 05:04 henon

Same issue here, net 8, server side.

viniciusmiguel avatar Jun 02 '24 19:06 viniciusmiguel

I am looking into the code for a fix but it looks like this repository does not represent the nuget package being distributed anymore.

viniciusmiguel avatar Jun 02 '24 20:06 viniciusmiguel

I am looking into the code for a fix but it looks like this repository does not represent the nuget package being distributed anymore.

I think the latest changes are in this branch: https://github.com/MudBlazor/ThemeManager/tree/hotfix. I'm not sure why, but I can see that the 1.0.9 version is present there. I don't think we have anyone currently maintaining this since it was previously handled by @Garderoben.

ScarletKuro avatar Jun 02 '24 20:06 ScarletKuro

@henon maybe you want to merge the hotfix to main and remove the hotfix. Also I can add same CI/CD as I did for https://github.com/MudBlazor/MudBlazor.Icons but I don't have access to the settings of this repo at all

upd: nvm about merging, it looks pretty de-sync and the code in main was suppose to be the "new" theme manager, but it's pretty unfinished, so i guess just swap hotfix to be main and old main rename to "wip"?

ScarletKuro avatar Jun 02 '24 21:06 ScarletKuro

so i guess just swap hotfix to be main and old main rename to "wip"?

ok

henon avatar Jun 03 '24 08:06 henon

upd: nvm about merging, it looks pretty de-sync and the code in main was suppose to be the "new" theme manager, but it's pretty unfinished, so i guess just swap hotfix to be main and old main rename to "wip"?

Swapped. Now the main code is located in the "main" branch, while the old main is renamed to "wip"

ScarletKuro avatar Jun 05 '24 13:06 ScarletKuro

Thanks a lot @ScarletKuro

henon avatar Jun 05 '24 14:06 henon

Ok, I set up CI/CD and released version 1.1.0 with small improvements, like replacing async void with async Task. If someone wants to contribute, feel free to do so as it will be easier to deliver the changes now. Previously, someone with access had to manually upload the package, which was always delayed with no ETA.

ScarletKuro avatar Jun 05 '24 18:06 ScarletKuro