Skip to content

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!

}
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