From 7d3bc44bb0257baff2728ed0ec97c81cb636bcf5 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Tue, 9 Nov 2021 15:43:02 +0200 Subject: [PATCH] dropdown: Move constant --- js/src/dropdown.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/js/src/dropdown.js b/js/src/dropdown.js index 9baa8d3a1a..7f3b92655b 100644 --- a/js/src/dropdown.js +++ b/js/src/dropdown.js @@ -359,10 +359,6 @@ class Dropdown extends BaseComponent { continue } - const relatedTarget = { - relatedTarget: context._element - } - const composedPath = event.composedPath() const isMenuTarget = composedPath.includes(context._menu) if ( @@ -378,6 +374,8 @@ class Dropdown extends BaseComponent { continue } + const relatedTarget = { relatedTarget: context._element } + if (event.type === 'click') { relatedTarget.clickEvent = event }