Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to toggle Panel by Active attribute #3871

Open
shirleen1234 opened this issue May 20, 2024 · 0 comments
Open

Unable to toggle Panel by Active attribute #3871

shirleen1234 opened this issue May 20, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@shirleen1234
Copy link

Describe the bug

Failed to change the active state of a Panel using the Active attribute.

Steps to reproduce (please include code)

<Button Shape="circle" Icon="@(_expandAll ? "up" : "down")" OnClick="@ToggleExpandAll" />

<Collapse DefaultActiveKey="@(new[]{"1"})" OnChange="Callback" Animation>
    <Panel Header="This is panel header 1" Key="1" Active="_expandAll">
        <p>@text</p>
    </Panel>
    <Panel Key="2" Active="_expandAll">
        <HeaderTemplate>
            This is panel header 2
        </HeaderTemplate>
        <ChildContent>
            <p>@text</p>
        </ChildContent>
    </Panel>
    <Panel Header="This is panel header 3" Key="3" Disabled Active="_expandAll">
        <p>@text</p>
    </Panel>
</Collapse>

@code {
    bool _expandAll;

    void Callback(string[] keys)
    {
        Console.WriteLine(string.Join(',', keys));
    }

    private void ToggleExpandAll()
    {
        _expandAll = !_expandAll;

        StateHasChanged();
    }
}

Exceptions (if any)

Further technical details

  • AntDesign Nuget Package v0.19.0
@ElderJames ElderJames added the enhancement New feature or request label May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants