From 2321fbfcabec653a8e9ca71c19be4e7e2127374d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Wed, 20 Jan 2021 10:15:52 +0100 Subject: [PATCH] empty value should also enable in order to stay backwards compatible. --- .../forms/umbautofocus.directive.js | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/forms/umbautofocus.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/forms/umbautofocus.directive.js index 47ef460c53..98c4ef691e 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/forms/umbautofocus.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/forms/umbautofocus.directive.js @@ -10,18 +10,14 @@ angular.module("umbraco.directives") } }; - //check if there's a value for the attribute, if there is and it's false then we conditionally don't - //use auto focus. - if (attrs.umbAutoFocus) { - attrs.$observe("umbAutoFocus", function (newVal) { - var enabled = (newVal === "false" || newVal === 0 || newVal === false) ? false : true; - if (enabled) { - $timeout(function() { - update(); - }); - } - }); - } + attrs.$observe("umbAutoFocus", function (newVal) { + var enabled = (newVal === "false" || newVal === 0 || newVal === false) ? false : true; + if (enabled) { + $timeout(function() { + update(); + }); + } + }); }; });