From 9372b1df47f6a80cb9b9b4e86052d5050f450b43 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 22 Oct 2015 14:02:18 +0200 Subject: [PATCH] fix placeholder width on input auto resize in firefox --- .../directives/editors/umbAutoResize.directive.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/editors/umbAutoResize.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/editors/umbAutoResize.directive.js index e28d6ef29e..5ba8839d08 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/editors/umbAutoResize.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/editors/umbAutoResize.directive.js @@ -69,18 +69,14 @@ angular.module("umbraco.directives") function resizeInput() { if (domEl.scrollWidth !== domEl.clientWidth) { - - if (ngModelController.$modelValue === undefined || ngModelController.$modelValue === "" || ngModelController.$modelValue === null) { - - if (attr.placeholder) { - attr.$set('size', attr.placeholder.length); - element.width('auto'); - } - - } else { + if (ngModelController.$modelValue) { element.width(domEl.scrollWidth); } + } + if(!ngModelController.$modelValue && attr.placeholder) { + attr.$set('size', attr.placeholder.length); + element.width('auto'); } }