livewire / flux

The official Livewire UI component library
https://fluxui.dev
482 stars 42 forks source link

Dropdown not closing on click #253

Closed DonCamillo11 closed 1 month ago

DonCamillo11 commented 1 month ago

I would have expected a dropdown to close when clicked on the dropdown button itself. Is there a reason why this isn't the case? A dropdown is only closing on an outside click.

helderneves91 commented 1 month ago

Can you share the code to replicate the issue?

DonCamillo11 commented 1 month ago

This is my dropdown.

<flux:dropdown>
    <flux:button wire:click.prevent.stop square icon="ellipsis-horizontal"  variant="ghost"></flux:button>
    <flux:menu>
        <flux:menu.item icon="pencil-square">Save</flux:menu.item>
        <flux:menu.item icon="document-duplicate">Duplicate</flux:menu.item>
        <flux:menu.item icon="trash" variant="danger">Delete</flux:menu.item>
    </flux:menu>
</flux:dropdown>

But you can replicate on the docs https://fluxui.dev/components/dropdown. It’s the same behaviour.

helderneves91 commented 1 month ago

Well, I tested and the dropdown closes if I click in any option.

Do composer update to update flux and delete any published flux stubs

DonCamillo11 commented 1 month ago

I don't mean the options in the dropdown. I mean the dropdown button itself. Usually you can close the dropdown the same way as you opened it.

omniith commented 1 month ago

I tested as well, no issues on my side for closing the dropdown. Best you share your layouts or work on a separate layout file and put flux dropdown there to see where is the issue while comparing to your existing.

AH i see what you mean, yes re-clicking the button does not close.

vincentcordel commented 1 month ago

Is there a reason why it's not implemented? This is the default behaviour in most UI components elsewhere...

0hra commented 1 month ago

I would like to see this as well.

calebporzio commented 1 month ago

Fixing this is a high priority. It's not trivial because of the way the [popover] attribute behaves by default. But we will fix this in short order.

calebporzio commented 1 month ago

Thank you for the report. This issue has been fixed and will be available in the next release.