File tree Expand file tree Collapse file tree 5 files changed +24
-2
lines changed Expand file tree Collapse file tree 5 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -10,12 +10,17 @@ $select-ios-padding-bottom: $item-ios-padding-bottom !default;
10
10
$select-ios-padding-left : $item-ios-padding-left !default ;
11
11
12
12
$select-ios-icon-color : #999 !default ;
13
+ $select-ios-placeholder-color : $select-ios-icon-color !default ;
13
14
14
15
15
16
ion-select {
16
17
padding : $select-ios-padding-top $select-ios-padding-right $select-ios-padding-bottom $select-ios-padding-left ;
17
18
}
18
19
20
+ .select-placeholder {
21
+ color : $select-ios-placeholder-color ;
22
+ }
23
+
19
24
.select-icon {
20
25
position : relative ;
21
26
Original file line number Diff line number Diff line change @@ -10,12 +10,17 @@ $select-md-padding-bottom: $item-md-padding-bottom !default;
10
10
$select-md-padding-left : $item-md-padding-left !default ;
11
11
12
12
$select-md-icon-color : #999 !default ;
13
+ $select-md-placeholder-color : $select-md-icon-color !default ;
13
14
14
15
15
16
ion-select {
16
17
padding : $select-md-padding-top $select-md-padding-right $select-md-padding-bottom $select-md-padding-left ;
17
18
}
18
19
20
+ .select-placeholder {
21
+ color : $select-md-placeholder-color ;
22
+ }
23
+
19
24
.item-select ion-label {
20
25
margin-left : 0 ;
21
26
}
Original file line number Diff line number Diff line change @@ -116,7 +116,8 @@ const SELECT_VALUE_ACCESSOR = new Provider(
116
116
@Component ( {
117
117
selector : 'ion-select' ,
118
118
template :
119
- '<div class="select-text">{{_text}}</div>' +
119
+ '<div *ngIf="!_text" class="select-placeholder select-text">{{placeholder}}</div>' +
120
+ '<div *ngIf="_text" class="select-text">{{_text}}</div>' +
120
121
'<div class="select-icon">' +
121
122
'<div class="select-icon-inner"></div>' +
122
123
'</div>' +
@@ -159,6 +160,11 @@ export class Select {
159
160
*/
160
161
@Input ( ) okText : string = 'OK' ;
161
162
163
+ /**
164
+ * @input {string} The text to display when the select is empty.
165
+ */
166
+ @Input ( ) placeholder : string ;
167
+
162
168
/**
163
169
* @input {any} Any addition options that the alert interface can take.
164
170
* See the [Alert API docs](../../alert/Alert) for the create options.
Original file line number Diff line number Diff line change @@ -17,7 +17,9 @@ $select-wp-border-color: $input-wp-border-color !default;
17
17
18
18
$select-wp-icon-width : 18px !default ;
19
19
$select-wp-icon-arrow-width : 2px !default ;
20
+
20
21
$select-wp-icon-color : $select-wp-border-color !default ;
22
+ $select-wp-placeholder-color : $select-wp-icon-color !default ;
21
23
22
24
23
25
ion-select {
@@ -32,6 +34,10 @@ ion-select {
32
34
line-height : 3rem ;
33
35
}
34
36
37
+ .select-placeholder {
38
+ color : $select-wp-placeholder-color ;
39
+ }
40
+
35
41
.item-select ion-label {
36
42
margin-left : 0 ;
37
43
}
Original file line number Diff line number Diff line change 49
49
50
50
< ion-item >
51
51
< ion-label > Music</ ion-label >
52
- < ion-select [(ngModel)] ="music " [alertOptions] ="musicAlertOpts ">
52
+ < ion-select [(ngModel)] ="music " [alertOptions] ="musicAlertOpts " placeholder =" Select Music " >
53
53
< ion-option > Alice in Chains</ ion-option >
54
54
< ion-option > Green Day</ ion-option >
55
55
< ion-option > Nirvana</ ion-option >
You can’t perform that action at this time.
0 commit comments