Refined close filter dropdown behavior

closes https://github.com/TryGhost/Team/issues/976

Dropdown's `onClose` action was previously fired from the `close` function instead of when the actual close happened when animation ended for dropdown close. Also, the `close` action of dropdown is fired irrespective of dropdown is open, as we close all dropdowns and menus whenever a new transition happens, so it caused flicker on the screen.
This commit is contained in:
Rishabh 2021-09-06 12:42:43 +05:30
parent d691874c5f
commit 9b5cd1ac8b

View File

@ -37,6 +37,7 @@ export default Component.extend(DropdownMixin, {
if (event.animationName === 'fade-out' && this.closing) {
this.set('isOpen', false);
this.set('closing', false);
this.onClose?.();
}
});
@ -61,7 +62,6 @@ export default Component.extend(DropdownMixin, {
close() {
this.set('closing', true);
this.onClose?.();
if (this.button) {
this.set('button.isOpen', false);
}