Make tag-input support dirty handling on tag deletion

This commit is contained in:
Johannes Zellner
2020-03-25 06:13:44 +01:00
parent dde287f05d
commit 7bcec61e6d

View File

@@ -581,7 +581,8 @@ app.directive('tagInput', function () {
scope: {
inputTags: '=taglist'
},
link: function ($scope, element, attrs) {
require: '^form',
link: function ($scope, element, attrs, formCtrl) {
$scope.defaultWidth = 200;
$scope.tagText = ''; // current tag being edited
$scope.placeholder = attrs.placeholder;
@@ -613,6 +614,7 @@ app.directive('tagInput', function () {
tagArray.splice(key, 1);
}
}
formCtrl.$setDirty();
return $scope.inputTags = tagArray.join(',');
};
$scope.$watch('tagText', function (newVal, oldVal) {