Skip to content

Commit

Permalink
fix(popup): Fix tag/project dropdown toggle
Browse files Browse the repository at this point in the history
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
  • Loading branch information
nunofmn authored and dooart committed Sep 30, 2019
1 parent 027dd97 commit d40b843
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/scripts/popup.js
Expand Up @@ -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) => {
Expand Down

0 comments on commit d40b843

Please sign in to comment.