File tree 4 files changed +31
-6
lines changed
4 files changed +31
-6
lines changed Original file line number Diff line number Diff line change 450
450
}
451
451
452
452
& .md-invalid {
453
+ @keyframes md-invalid-shake {
454
+ 10%, 90% {
455
+ transform : translate3d (-1px , 0 , 0 );
456
+ }
457
+
458
+ 30%, 70% {
459
+ transform : translate3d (-4px , 0 , 0 );
460
+ }
461
+
462
+ 40%, 60% {
463
+ transform : translate3d (4px , 0 , 0 );
464
+ }
465
+ }
466
+
467
+ & .md-has-value label :not (:focus ) {
468
+ animation : md- invalid- shake .4s $md-transition-default-timing both ;
469
+ backface-visibility : hidden ;
470
+ perspective : 1000px ;
471
+ }
472
+
453
473
& .md-has-textarea :not (.md-autogrow ) {
454
474
& :before {
455
475
border-width : 2px ;
Original file line number Diff line number Diff line change @@ -31,8 +31,9 @@ export default {
31
31
}
32
32
} ,
33
33
watch : {
34
- value ( val ) {
35
- this . content = val
34
+ value ( value ) {
35
+ this . content = value
36
+ this . setFieldValue ( )
36
37
} ,
37
38
clear ( clear ) {
38
39
if ( clear ) {
@@ -57,7 +58,6 @@ export default {
57
58
this . $el . value = ''
58
59
this . content = ''
59
60
this . setFieldValue ( )
60
- this . $emit ( 'input' , '' )
61
61
} ,
62
62
setLabelFor ( ) {
63
63
const label = this . $el . parentNode . querySelector ( 'label' )
@@ -93,7 +93,10 @@ export default {
93
93
this . MdField . focused = false
94
94
} ,
95
95
onInput ( ) {
96
- this . setFieldValue ( )
96
+ const newValue = this . $el ? this . $el . value : this . content
97
+
98
+ this . $emit ( 'input' , newValue )
99
+ this . MdField . value = newValue
97
100
}
98
101
} ,
99
102
created ( ) {
Original file line number Diff line number Diff line change 6
6
v-model =" content"
7
7
@focus =" onFocus"
8
8
@blur =" onBlur"
9
- @input =" onInput" >
9
+ @input =" onInput"
10
+ @change =" onInput" >
10
11
</template >
11
12
12
13
<script >
Original file line number Diff line number Diff line change 7
7
v-model =" content"
8
8
@focus =" onFocus"
9
9
@blur =" onBlur"
10
- @input =" onInput" >
10
+ @input =" onInput"
11
+ @change =" onInput" >
11
12
</textarea >
12
13
</template >
13
14
You can’t perform that action at this time.
0 commit comments