OLD | NEW |
| (Empty) |
1 <!-- | |
2 Copyright (c) 2014 The Polymer Project Authors. All rights reserved. | |
3 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE | |
4 The complete set of authors may be found at http://polymer.github.io/AUTHORS | |
5 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS | |
6 Code distributed by Google as part of the polymer project is also | |
7 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS | |
8 --><!-- | |
9 `paper-autogrow-textarea` is an element containing a textarea that grows in heig
ht as more | |
10 lines of input are entered. Unless an explicit height or the `maxRows` property
is set, it will | |
11 never scroll. | |
12 | |
13 Example: | |
14 | |
15 <paper-autogrow-textarea id="a1"> | |
16 <textarea id="t1"></textarea> | |
17 <paper-autogrow-textarea> | |
18 | |
19 Because the `textarea`'s `value` property is not observable, if you set the `val
ue` imperatively | |
20 you must call `update` to notify this element the value has changed. | |
21 | |
22 Example: | |
23 | |
24 /* using example HTML above */ | |
25 t1.value = 'some\ntext'; | |
26 a1.update(); | |
27 | |
28 @group Paper Elements | |
29 @element paper-autogrow-textarea | |
30 @status unstable | |
31 --><html><head><link href="../polymer/polymer.html" rel="import"> | |
32 | |
33 </head><body><polymer-element name="paper-autogrow-textarea" on-input="{{inputAc
tion}}" assetpath=""> | |
34 <template> | |
35 | |
36 <style> | |
37 :host { | |
38 display: inline-block; | |
39 position: relative; | |
40 width: 400px; | |
41 } | |
42 | |
43 .mirror-text { | |
44 visibility: hidden; | |
45 } | |
46 | |
47 ::content textarea { | |
48 padding: 0; | |
49 margin: 0; | |
50 border: none; | |
51 outline: none; | |
52 resize: none; | |
53 /* see comments in template */ | |
54 width: 100%; | |
55 height: 100%; | |
56 } | |
57 | |
58 ::content textarea:invalid { | |
59 box-shadow: none; | |
60 } | |
61 </style> | |
62 | |
63 <!-- the mirror sizes the input/textarea so it grows with typing --> | |
64 <div id="mirror" class="mirror-text" aria-hidden="true"> </div> | |
65 | |
66 <!-- size the input/textarea with a div, because the textarea has intrinsic si
ze in ff --> | |
67 <div class="textarea-container" fit=""> | |
68 <content></content> | |
69 </div> | |
70 | |
71 </template> | |
72 | |
73 </polymer-element> | |
74 <script charset="utf-8" src="paper-autogrow-textarea-extracted.js"></script></bo
dy></html> | |
OLD | NEW |