fix placeholder width on input auto resize in firefox
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user