From d8862c85bfe8de33182e103d1aad87175424be4a Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 21 Nov 2013 12:16:26 +1100 Subject: [PATCH] Fixes tags property editor to not submit the html form when pressing enter. --- .../src/views/propertyeditors/tags/tags.controller.js | 4 ++++ .../src/views/propertyeditors/tags/tags.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags/tags.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags/tags.controller.js index ee62d20026..8b641ebc98 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags/tags.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags/tags.controller.js @@ -11,6 +11,10 @@ angular.module("umbraco") $scope.addTag = function(e) { var code = e.keyCode || e.which; if (code == 13) { //Enter keycode + + //this is required, otherwise the html form will attempt to submit. + e.preventDefault(); + if ($scope.currentTags.indexOf($scope.tagToAdd) < 0) { $scope.currentTags.push($scope.tagToAdd); } diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags/tags.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags/tags.html index 002855a1f0..d0451a41c0 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags/tags.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags/tags.html @@ -2,7 +2,7 @@ {{tag}} \ No newline at end of file