File tree Expand file tree Collapse file tree 2 files changed +71
-2
lines changed Expand file tree Collapse file tree 2 files changed +71
-2
lines changed Original file line number Diff line number Diff line change
1
+ import baseField from './baseField' ;
2
+ export default {
3
+ mixins : [ baseField ] ,
4
+ render ( h ) {
5
+ const self = this ;
6
+ const children = [ ] ;
7
+
8
+ // add the label if it needs it
9
+ if ( this . to . label ) children . push (
10
+ h ( 'label' , {
11
+ attrs : {
12
+ 'for' : this . to . id
13
+ }
14
+ } , this . to . label )
15
+ ) ;
16
+
17
+ // add the textarea
18
+ children . push (
19
+ h ( 'textarea' , {
20
+ attrs : {
21
+ id : this . to . id ,
22
+ ...this . to . atts
23
+ } ,
24
+ 'class' : {
25
+ 'form-control' : true ,
26
+ ...this . to . classes
27
+ } ,
28
+ domProps : {
29
+ value : this . model [ this . field . key ]
30
+ } ,
31
+ on : {
32
+ input ( event ) {
33
+ self . model [ self . field . key ] = event . target . value ;
34
+ self . $emit ( 'input' , event . target . value ) ;
35
+ } ,
36
+ blur : this . onBlur ,
37
+ focus : this . onFocus ,
38
+ click : this . onClick ,
39
+ change : this . onChange ,
40
+ keyup : this . onKeyup ,
41
+ keydown : this . onKeydown
42
+ }
43
+ } )
44
+ ) ;
45
+
46
+ // add the error element
47
+ children . push (
48
+ h ( 'error-display' , {
49
+ props : {
50
+ form : this . form ,
51
+ field : this . field . key
52
+ }
53
+ } )
54
+ ) ;
55
+
56
+ // create the wrapper element
57
+ return h ( 'div' , {
58
+ 'class' : [
59
+ 'form-group formly-textarea' ,
60
+ this . to . wrapperClasses ,
61
+ {
62
+ 'formly-has-value' : this . model [ this . field . key ] ,
63
+ 'formly-has-focus' : this . form [ this . field . key ] . $active ,
64
+ 'has-error has-danger' : this . hasError
65
+ }
66
+ ]
67
+ } , children ) ;
68
+ }
69
+ }
Original file line number Diff line number Diff line change @@ -365,8 +365,6 @@ describe('Bootstrap Field Inputs', () => {
365
365
} ) ;
366
366
367
367
} ) ;
368
-
369
- return ;
370
368
371
369
describe ( 'Textarea' , ( ) => {
372
370
describe ( 'functions' , ( ) => {
@@ -389,6 +387,8 @@ describe('Bootstrap Field Inputs', () => {
389
387
expect ( inputs ) . to . be . length ( 1 ) ;
390
388
} ) ;
391
389
} ) ;
390
+
391
+ return ;
392
392
393
393
describe ( "List" , ( ) => {
394
394
describe ( 'checkbox functions' , ( ) => {
You can’t perform that action at this time.
0 commit comments