Bug #403 Textfield ha dejado de mostrar los errores
This commit is contained in:
parent
13e9b53a73
commit
2737bc0b0b
|
@ -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;
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue