tech-systems / panes

🎉📱 Create dynamic modals, cards, panes for your applications in few steps. One instance – Thousands solutions. Any framework and free.
https://panejs.com
MIT License
687 stars 40 forks source link

[FEAT] onWillHide/onDidHide methods for .hide() function #207

Closed ChristopherJohnson25 closed 1 year ago

ChristopherJohnson25 commented 1 year ago

Describe the bug .hide() does not trigger did/willDismiss. Perhaps this is not a bug, but we still should have a clear way to know state of drawer when it's hidden, not just destroyed.

To Reproduce cupertino.hide(); notice that didDismiss is not called anywhere

Expected behavior onDidDismiss should be called.

roman-rr commented 1 year ago

@ChristopherJohnson25 Thank you. Actually, you can listen onTransitionEnd and check with

if (myPane.isHidden()) {
 // ...
}

But if you feels like it's good to create new event onDidHide, feel free to make a pull request and I will merge with pleasure.

Can be implemented in such ways: a) Emit onDidDismiss additionally in .hide() function with params {hide: true} b) Emit new event this.emit('onDidHide'); in hide() function and add new event in types.

I will do it personally if here is huge demand.

ChristopherJohnson25 commented 1 year ago

@roman-rr - thank you! onTransitionEnd check as shown above should be sufficient. If I feel so inclined, I will give you a PR.