Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #420 - Splitting onOpen and onClose to before and after actions #494

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Ryan-Bell
Copy link

Issue #420

My attempt at implementing onBeforeOpen, onBeforeClose, onAfterOpen, onAfterClose hooks.

I wasn't sure what arguments should be passed to the "after" hooks and whether or not onAfterClose should be called if the dropdown has been destroyed.

Let me know if there are any changes to documentation/implementation or tests you want.

Thanks for the great addon!

return;
}
this.updateState({ isOpen: true });
if (this.onAfterOpen) {
this.onAfterOpen(this.publicAPI, e);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% if we should call it here or wait until the afterRender step.
I lean towards your solution, and let the user wait for the render if they want to.

@cibernox
Copy link
Owner

This looks great. I just have one request. Can you update Ember Power Select to use the new onBeforeOpen/onBeforeClose hooks? Otherwise there will be a lot of noise. After that I'll merge it

@cibernox
Copy link
Owner

It's also worth noting that I'm planing a new major release updating to GlimmerComponents, and it would be a good moment to remove the now-deprecated onOpen/onClose

@Ryan-Bell
Copy link
Author

Awesome! Quick question, should onAfterOpen and onAfterClose be exposed in ember-power-select or is it enough to update the onOpen and onClose internally? I noticed power-select-multiple.hbs has @onClose={{@onClose}}. Will this have to be updated to @onBeforeClose={{@onClose}}

@hadiwina
Copy link

Is this PR no longer be merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants