From 9b5cd1ac8b335aa148e753fdb52f3ba2afe11b83 Mon Sep 17 00:00:00 2001 From: Rishabh Date: Mon, 6 Sep 2021 12:42:43 +0530 Subject: [PATCH] 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. --- ghost/admin/app/components/gh-dropdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghost/admin/app/components/gh-dropdown.js b/ghost/admin/app/components/gh-dropdown.js index 3225cc0ac3..3bb5b8a28e 100644 --- a/ghost/admin/app/components/gh-dropdown.js +++ b/ghost/admin/app/components/gh-dropdown.js @@ -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); }