CaptainCodeman / svelte-headlessui

HeadlessUI components for Svelte
https://captaincodeman.github.io/svelte-headlessui/
MIT License
529 stars 25 forks source link

Feature request: dispatch event according actions for easier integration with other libraries #54

Open winston0410 opened 1 year ago

winston0410 commented 1 year ago

Right now this lib does not dispatch any event, which makes integrating with other libraries difficult. For example, if I am using Dialog action, it would be great if an close event will be dispatched when dialog.close is called, so that I can do something custom after that dialog is closed(For example toggle a boolean in local storage so that user will not see that dialog again)

Is that something you would consider in this library? I can help with PR but want to know your thought first

winston0410 commented 1 year ago

@CaptainCodeman Do you have any thought on this? Right now I can see Grail UI is offering an event handler, and it would be great this library of this as well, (and even better we emit the event through native API, so user can consume the event with on:custom_event where ever they want)

CaptainCodeman commented 11 months ago

Yes, I think some events would make sense. The main ones I can think of will be things opening / closing and selections changing.