Skip to content

Commit

Permalink
Fixed the 'enter doesn't work while editing a task'-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
florisweb committed Mar 6, 2021
1 parent 4f64bb4 commit a038861
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/js/eventHandlers/keyHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ function _KeyHandler() {


// Menu's
if (MainContent.taskHolder.dateOptionMenu.openState) return MainContent.taskHolder.dateOptionMenu.clickFirstOption();
if (MainContent.searchOptionMenu.openState) return MainContent.searchOptionMenu.clickFirstOption();
if (MainContent.taskHolder.dateOptionMenu.openState && MainContent.taskHolder.dateOptionMenu.clickFirstOption()) return;
if (MainContent.searchOptionMenu.openState && MainContent.searchOptionMenu.clickFirstOption()) return;

if (MainContent.taskHolder.curCreateMenu) return MainContent.taskHolder.curCreateMenu.createTask();
},
Expand Down
5 changes: 4 additions & 1 deletion src/js/mainContent/mainContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,10 @@ function _MainContent_searchOptionMenu() {
});
}

this.clickFirstOption = function () {Menu.clickFirstOption.apply(Menu);};
this.clickFirstOption = function () {
this.openState = false;
return Menu.clickFirstOption.apply(Menu);
};


this.close = function() {
Expand Down
3 changes: 2 additions & 1 deletion src/js/optionMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ function _OptionMenu_menu(_self) {

this.clickFirstOption = function() {
let option = this.options[0];
if (!option) return;
if (!option) return false;
option.select();
This.close();
return true;
}


Expand Down

0 comments on commit a038861

Please # to comment.