fix(item): inherit align-items from parent item (#19278)

inherits alignment in inner item, sets item alignment to center

fixes #18703
This commit is contained in:
Brandy Carney
2020-05-29 11:30:19 -04:00
committed by GitHub
parent 323e15003f
commit 882f8fef07
2 changed files with 21 additions and 8 deletions

View File

@ -13,7 +13,7 @@
<body>
<ion-app>
<ion-content class="ion-padding">
<ion-content>
<ion-item>
<ion-label position="floating">Floating: input</ion-label>
<ion-input></ion-input>
@ -34,6 +34,16 @@
<ion-label position="stacked">Stacked: div</ion-label>
<div>A div</div>
</ion-item>
<ion-item class="ion-align-items-center">
<ion-icon slot="start" name="planet"></ion-icon>
<ion-label position="stacked">Align items: center</ion-label>
<div>A div</div>
</ion-item>
<ion-item class="ion-align-items-center">
<ion-icon slot="start" name="planet"></ion-icon>
<ion-label position="stacked">Align items: center</ion-label>
<div class="ion-align-self-end">A div: align self right</div>
</ion-item>
<ion-item>
<ion-label position="floating">Floating: textarea</ion-label>
<ion-textarea></ion-textarea>

View File

@ -79,6 +79,9 @@
position: relative;
align-items: center;
justify-content: space-between;
outline: none;
color: var(--color);
@ -87,9 +90,9 @@
text-align: initial;
text-decoration: none;
box-sizing: border-box;
overflow: hidden;
box-sizing: border-box;
}
@ -202,8 +205,8 @@
display: flex;
position: relative;
align-items: center;
justify-content: space-between;
align-items: inherit;
justify-content: inherit;
width: 100%;
min-height: var(--min-height);
@ -313,9 +316,8 @@ button, a {
// Item Input
// --------------------------------------------------
:host([vertical-align-top]),
:host(.item-input) {
align-items: flex-start;
align-items: center;
}
.input-wrapper {
@ -323,6 +325,7 @@ button, a {
flex: 1;
flex-direction: inherit;
align-items: inherit;
align-self: stretch;
@ -332,8 +335,8 @@ button, a {
box-sizing: border-box;
}
:host(.item-label-stacked) .item-native,
:host(.item-label-floating) .item-native {
:host(.item-label-stacked),
:host(.item-label-floating) {
align-items: start;
}