Closed saturnonearth closed 1 year ago
Can you post a code snippet of what you mean? I tried adding an on:click
handler directly to the buttons here and that seems to work, so I'm probably not fully understanding what you're describing.
<a use:menu.item class="w-full flex items-center" href={option.href(id)}> <Icon src={option.icon} theme="outline" width="20" height="20" class="flex-shrink-0 mr-2 h-5 w-5" />{option.text}</a>
The custom event on the use:menu.item prevents anything from actually running within the button itself. If you put a form button there, it will not actually submit the form.
For instance, this will not submit a form.
<button type="submit" form="deleteItem" use:menu.item>Submit</button>
Ah, I see - I probably just need to remove the .preventDefault()
that get's added. I'll check that doesn't affect anything, I don't think it would. It should then also allow you to use the different menu options as different form submit actions.
Sadly it appears to still be blocked somehow.
Sorry, I haven't had chance to publish it yet :)
haha oops 🤦
No worries, should be there now.
I want to change the menu dropdown buttons to trigger a form, and another to be an anchor link, but the current implementation does not allow it. It seems to disable any events on that actual menu item in order to file the custom event.