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

ToggleIconVisible not working for DropdownToggle in Tailwind #5114

Closed
stsrki opened this issue Oct 27, 2023 Discussed in #5111 · 0 comments
Closed

ToggleIconVisible not working for DropdownToggle in Tailwind #5114

stsrki opened this issue Oct 27, 2023 Discussed in #5111 · 0 comments
Assignees
Labels
Type: Bug 🐞 Something isn't working
Projects
Milestone

Comments

@stsrki
Copy link
Collaborator

stsrki commented Oct 27, 2023

Discussed in #5111

Originally posted by mdmontesinos October 26, 2023
Is there any way to open a dropdown with a custom toggle instead of the regular one?

Basically, I want to have a Dropdown that is opened using an icon instead of a button, something like this:

image

<Dropdown @ref="_dropdown">
    <DropdownToggle>
        <Icon Name="IconName.Bell"></Icon>
    </DropdownToggle>
    <DropdownMenu>
        <DropdownItem>Item 1</DropdownItem>
        <DropdownItem>Item 2</DropdownItem>
        <DropdownItem>Item 3</DropdownItem>
    </DropdownMenu>
</Dropdown>

But I still get the toggle icon, which I would like to get rid of.

I've also tried using the ref and DropdownMenuTargetId to programatically open the dropdown:

<Dropdown @ref="_dropdown" DropdownMenuTargetId="target">
    <DropdownMenu>
        <DropdownItem>Item 1</DropdownItem>
        <DropdownItem>Item 2</DropdownItem>
        <DropdownItem>Item 3</DropdownItem>
    </DropdownMenu>
</Dropdown>

<Button Color="Color.Primary" id="target" @onclick="@(() => ShowMenu())">Toggle</Button>

But if I remove the DropdownToggle or set Display to None, the position of the dropdown is sometimes bugged, and also can't be closed by clicking elsewhere.

@stsrki stsrki added the Type: Bug 🐞 Something isn't working label Oct 27, 2023
@stsrki stsrki added this to the 1.3 support milestone Oct 27, 2023
@stsrki stsrki added this to 🔙 Backlog in Support via automation Oct 27, 2023
@stsrki stsrki self-assigned this Oct 27, 2023
@stsrki stsrki closed this as completed Nov 1, 2023
Support automation moved this from 🔙 Backlog to ✔ Done Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 🐞 Something isn't working
Projects
Support
  
✔ Done
Development

No branches or pull requests

1 participant