Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / polymer / v1_0 / components-chromium / iron-autogrow-textarea / iron-autogrow-textarea.html
blob6c083cd20065fa2767015f3df18bb854a0dfa327
1 <!--
2 @license
3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4 This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 Code distributed by Google as part of the polymer project is also
8 subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 --><html><head><link rel="import" href="../polymer/polymer.html">
10 <link rel="import" href="../iron-behaviors/iron-control-state.html">
11 <link rel="import" href="../iron-flex-layout/classes/iron-flex-layout.html">
12 <link rel="import" href="../iron-validatable-behavior/iron-validatable-behavior.html">
13 <link rel="import" href="../iron-form-element-behavior/iron-form-element-behavior.html">
15 <!--
16 `iron-autogrow-textarea` is an element containing a textarea that grows in height as more
17 lines of input are entered. Unless an explicit height or the `maxRows` property is set, it will
18 never scroll.
20 Example:
22 <iron-autogrow-textarea></iron-autogrow-textarea>
24 Because the `textarea`'s `value` property is not observable, you should use
25 this element's `bind-value` instead for imperative updates.
27 @group Iron Elements
28 @hero hero.svg
29 @demo demo/index.html
30 -->
32 </head><body><dom-module id="iron-autogrow-textarea">
34 <style>
35 :host {
36 display: inline-block;
37 position: relative;
38 width: 400px;
39 border: 1px solid;
40 padding: 2px;
41 -moz-appearance: textarea;
42 -webkit-appearance: textarea;
45 .mirror-text {
46 visibility: hidden;
47 word-wrap: break-word;
50 textarea {
51 position: relative;
52 outline: none;
53 border: none;
54 resize: none;
55 background: inherit;
56 color: inherit;
57 /* see comments in template */
58 width: 100%;
59 height: 100%;
60 font-size: inherit;
61 font-family: inherit;
62 line-height: inherit;
65 ::content textarea:invalid {
66 box-shadow: none;
69 </style>
70 <template>
71 <!-- the mirror sizes the input/textarea so it grows with typing -->
72 <div id="mirror" class="mirror-text" aria-hidden="true">&nbsp;</div>
74 <!-- size the input/textarea with a div, because the textarea has intrinsic size in ff -->
75 <div class="textarea-container fit">
76 <textarea id="textarea" autocomplete$="[[autocomplete]]" autofocus$="[[autofocus]]" inputmode$="[[inputmode]]" placeholder$="[[placeholder]]" readonly$="[[readonly]]" required$="[[required]]" rows$="[[rows]]" maxlength$="[[maxlength]]"></textarea>
77 </div>
78 </template>
79 </dom-module>
81 <script src="iron-autogrow-textarea-extracted.js"></script></body></html>