Skip to content

Commit

Permalink
fix(select): make select full width when with a stacked/floating label
Browse files Browse the repository at this point in the history
if it is with a floating label, the label will stay stacked instead of
floating

closes #5715
  • Loading branch information
brandyscarney committed Mar 9, 2016
1 parent 13b39b9 commit 4e37524
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 3 deletions.
7 changes: 7 additions & 0 deletions ionic/components/input/input.ios.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ $text-input-ios-input-clear-icon-size: 18px !default;
margin-bottom: 8px;
}

.item-label-stacked ion-select,
.item-label-floating ion-select {
padding-left: 0;
padding-top: 8px;
padding-bottom: 8px;
}

.item-label-floating .text-input.cloned-input,
.item-label-stacked .text-input.cloned-input {
top: 30px;
Expand Down
7 changes: 7 additions & 0 deletions ionic/components/input/input.md.scss
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ ion-input.ng-invalid.ng-touched:after {
margin-bottom: 8px;
}

.item-label-stacked ion-select,
.item-label-floating ion-select {
padding-left: 0;
padding-top: 8px;
padding-bottom: 8px;
}

.item-label-floating .text-input.cloned-input {
top: 32px;
}
Expand Down
7 changes: 7 additions & 0 deletions ionic/components/input/input.wp.scss
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ ion-input.ng-invalid.ng-touched .text-input {
margin-bottom: 8px;
}

.item-label-stacked ion-select,
.item-label-floating ion-select {
padding-left: 0;
padding-top: 8px;
padding-bottom: 8px;
}

.item-label-floating .text-input.cloned-input {
top: 32px;
}
Expand Down
11 changes: 9 additions & 2 deletions ionic/components/input/test/stacked-labels/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import {App} from 'ionic-angular';
import {App, Page} from 'ionic-angular';


@App({
template: '<ion-nav [root]="rootPage"></ion-nav>'
})
class E2EApp {
rootPage = PageOne;
}

@Page({
templateUrl: 'main.html'
})
class E2EApp {}
class PageOne {}
5 changes: 4 additions & 1 deletion ionic/components/input/test/stacked-labels/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@

<ion-item>
<ion-label stacked>Label 6</ion-label>
<ion-input value="email6@email.com" type="email"></ion-input>
<ion-select [(ngModel)]="gender">
<ion-option value="f" checked="true">Female</ion-option>
<ion-option value="m">Male</ion-option>
</ion-select>
</ion-item>

<ion-item>
Expand Down
10 changes: 10 additions & 0 deletions ionic/components/label/label.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,13 @@ ion-label[floating] {
flex: 1;
flex-direction: column;
}

.item-label-stacked ion-select,
.item-label-floating ion-select {
width: 100%;
max-width: 100%;
}

.item-select ion-label[floating] {
transform: translate3d(0, 0, 0) scale(0.8);
}

0 comments on commit 4e37524

Please sign in to comment.