Fixes issue where save tag is called twice because of blur + enter. Make enter blur instead, calls it only once. Calling it twice results in issue where dummy note is deleted, creating invalid interface state

This commit is contained in:
Mo Bitar
2018-05-16 23:33:39 -05:00
parent 5be3c5eab3
commit 1c9616c573
3 changed files with 9 additions and 7 deletions

View File

@@ -144,11 +144,11 @@ angular.module('app')
}
$scope.tagsSelectionMade = function(tag) {
$scope.selectedTag = tag;
if($scope.selectedNote && $scope.selectedNote.dummy) {
modelManager.removeItemLocally($scope.selectedNote);
}
$scope.selectedTag = tag;
}
$scope.tagsAddNew = function(tag) {

View File

@@ -129,10 +129,12 @@ angular.module('app')
return;
}
this.save()(tag, function(savedTag){
this.selectTag(tag);
this.newTag = null;
}.bind(this));
this.save()(tag, (savedTag) => {
$timeout(() => {
this.selectTag(tag);
this.newTag = null;
})
});
}
function inputElementForTag(tag) {