Bug #403 Textfield ha dejado de mostrar los errores

This commit is contained in:
gerard 2018-07-13 15:54:04 +02:00
parent 13e9b53a73
commit 2737bc0b0b
3 changed files with 8 additions and 2 deletions

View File

@ -49,7 +49,7 @@ vn-textfield {
label {
position: absolute;
bottom: 0;
padding: 4px;
padding: 4px 0!important;
pointer-events: none;
color: $secondary-font-color;
transition-duration: .2s;
@ -72,6 +72,7 @@ vn-textfield {
color: inherit;
padding: 4px;
box-sizing: border-box;
border-bottom: 0!important;
&[type=number] {
-moz-appearance: textfield;
@ -122,7 +123,6 @@ vn-textfield {
& > span.mdl-textfield__error {
visibility: visible;
margin-top: 9px;
}
& > label {
color: #d50000;

View File

@ -4,6 +4,7 @@
<div class="leftIcons"></div>
<div class="infix">
<input
class="mdl-textfield__input"
type="{{$ctrl.type}}"
name="{{$ctrl.name}}"
ng-model="$ctrl.value"

View File

@ -44,6 +44,7 @@ export default class Textfield extends Input {
if (this.hasValue) this.element.classList.add('not-empty');
else this.element.classList.remove('not-empty');
this.mdlUpdate();
}
get value() {
return this._value;
@ -57,6 +58,10 @@ export default class Textfield extends Input {
set vnTabIndex(value) {
this.input.tabindex = value;
}
mdlUpdate() {
let mdlElement = this.element.firstChild.MaterialTextfield;
if (mdlElement) mdlElement.updateClasses_();
}
clear() {
this.value = null;
this.input.focus();