From d40b8435530036946cbfbed94ddddba676eef916 Mon Sep 17 00:00:00 2001 From: Nuno Nogueira Date: Wed, 25 Sep 2019 17:18:46 +0100 Subject: [PATCH] fix(popup): Fix tag/project dropdown toggle There are two event handlers configured that are triggering the popdown (by calling the 'toggleDropdown' function): 1. A focus event configured in the class 'TB_Dialog_field' (parent of the element with id 'toggl-button-(tag|project)-placeholder') 2. A click event configured in the element with id 'toggl-button-(tag|project)-placeholder' This commit removes the 'focus' event handler from 'TB_Dialog_field', since it seems that it's no longer necessary. Another possible solution would be to add a 'e.stopPropagation' on the click event handler. Closes #1422 --- src/scripts/popup.js | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/scripts/popup.js b/src/scripts/popup.js index 09807ebd9..4706d8639 100644 --- a/src/scripts/popup.js +++ b/src/scripts/popup.js @@ -409,18 +409,6 @@ window.PopUp = { e.preventDefault(); }); - document - .querySelector('#toggl-button-project-placeholder') - .closest('.TB__Dialog__field') - .addEventListener('focus', (e) => { - PopUp.$projectAutocomplete.openDropdown(); - }); - document - .querySelector('#toggl-button-tag-placeholder') - .closest('.TB__Dialog__field') - .addEventListener('focus', (e) => { - PopUp.$tagAutocomplete.openDropdown(); - }); document .querySelector('#toggl-button-duration') .addEventListener('focus', (e) => {