Employ flexbox for auto-resizing of textareas
This change sets 'display: flex' and 'flex-direction: column' on the main child of gr-overlay to allow for scrolling and auto resizing of textareas when necessary, i.e. small viewports. Bug: Issue 4833 Change-Id: I5a073822691bd766336da1058658e3bbb5f108f5
This commit is contained in:
@@ -28,6 +28,11 @@ limitations under the License.
|
|||||||
opacity: .5;
|
opacity: .5;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
.main {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
label {
|
label {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
display: block;
|
display: block;
|
||||||
|
@@ -35,6 +35,11 @@ limitations under the License.
|
|||||||
iron-autogrow-textarea {
|
iron-autogrow-textarea {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
.main {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
.main label,
|
.main label,
|
||||||
.main input[type="text"] {
|
.main input[type="text"] {
|
||||||
display: block;
|
display: block;
|
||||||
@@ -66,6 +71,8 @@ limitations under the License.
|
|||||||
<iron-autogrow-textarea
|
<iron-autogrow-textarea
|
||||||
id="messageInput"
|
id="messageInput"
|
||||||
class="message"
|
class="message"
|
||||||
|
rows="4"
|
||||||
|
max-rows="15"
|
||||||
bind-value="{{message}}"></iron-autogrow-textarea>
|
bind-value="{{message}}"></iron-autogrow-textarea>
|
||||||
</div>
|
</div>
|
||||||
</gr-confirm-dialog>
|
</gr-confirm-dialog>
|
||||||
|
@@ -22,11 +22,23 @@ limitations under the License.
|
|||||||
<style>
|
<style>
|
||||||
:host {
|
:host {
|
||||||
display: block;
|
display: block;
|
||||||
|
max-height: 90vh;
|
||||||
|
}
|
||||||
|
.container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
max-height: 90vh;
|
||||||
}
|
}
|
||||||
header {
|
header {
|
||||||
border-bottom: 1px solid #ddd;
|
border-bottom: 1px solid #ddd;
|
||||||
|
flex-shrink: 0;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
main {
|
||||||
|
display: flex;
|
||||||
|
flex-shrink: 1;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
header,
|
header,
|
||||||
main,
|
main,
|
||||||
footer {
|
footer {
|
||||||
@@ -34,15 +46,20 @@ limitations under the License.
|
|||||||
}
|
}
|
||||||
footer {
|
footer {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-shrink: 0;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<header><content select=".header"></content></header>
|
<div class="container">
|
||||||
<main><content select=".main"></content></main>
|
<header><content select=".header"></content></header>
|
||||||
<footer>
|
<main><content select=".main"></content></main>
|
||||||
<gr-button primary on-tap="_handleConfirmTap">[[confirmLabel]]</gr-button>
|
<footer>
|
||||||
<gr-button on-tap="_handleCancelTap">Cancel</gr-button>
|
<gr-button primary on-tap="_handleConfirmTap">
|
||||||
</footer>
|
[[confirmLabel]]
|
||||||
|
</gr-button>
|
||||||
|
<gr-button on-tap="_handleCancelTap">Cancel</gr-button>
|
||||||
|
</footer>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script src="gr-confirm-dialog.js"></script>
|
<script src="gr-confirm-dialog.js"></script>
|
||||||
</dom-module>
|
</dom-module>
|
||||||
|
Reference in New Issue
Block a user