-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkoa-textarea-behavior.html
60 lines (51 loc) · 1.44 KB
/
koa-textarea-behavior.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<!--
@license
Copyright (c) 2015 Team King of App. All rights reserved.
This code may only be used under the MIT license.
-->
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../../bower_components/iron-form-element-behavior/iron-form-element-behavior.html">
<link rel="import" href="../../bower_components/koa-behaviors/koa-input-behavior.html">
<script>
Polymer.KoaTextareaBehaviorImpl = {
properties: {
_ariaLabelledBy: {
observer: '_ariaLabelledByChanged',
type: String
},
_ariaDescribedBy: {
observer: '_ariaDescribedByChanged',
type: String
},
/**
* The initial number of rows.
*/
rows: {
type: Number,
value: 1
},
/**
* The maximum number of rows this element can grow to until it
* scrolls. 0 means no maximum.
*/
maxRows: {
type: Number,
value: 0
}
},
_ariaLabelledByChanged: function(ariaLabelledBy) {
this.$.input.textarea.setAttribute('aria-labelledby', ariaLabelledBy);
},
_ariaDescribedByChanged: function(ariaDescribedBy) {
this.$.input.textarea.setAttribute('aria-describedby', ariaDescribedBy);
},
get _focusableElement() {
return this.$.input.textarea;
}
};
Polymer.KoaTextareaBehavior = [
Polymer.KoaInputBehavior,
Polymer.IronFormElementBehavior,
Polymer.KoaTextareaBehaviorImpl
];
</script>