svelte-headlessui icon indicating copy to clipboard operation
svelte-headlessui copied to clipboard

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

Open winston0410 opened this issue 2 years ago • 2 comments
trafficstars

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 avatar Apr 08 '23 08:04 winston0410

@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)

winston0410 avatar Jul 03 '23 15:07 winston0410

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

CaptainCodeman avatar Aug 11 '23 18:08 CaptainCodeman