You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* The visible label associated with the select. Use this if you need to render a plaintext label. The `label` property will take priority over the `label` slot if both are used.
* The visible label associated with the select. Use this if you need to render a plaintext label. The `label` property will take priority over the `label` slot if both are used.
Copy file name to clipboardExpand all lines: core/src/components/select/select.tsx
+52-9Lines changed: 52 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -32,9 +32,12 @@ import type { SelectChangeEventDetail, SelectInterface, SelectCompareFn } from '
32
32
/**
33
33
* @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use.
34
34
*
35
+
* @slot label - label - The label text to associate with the select. Use the "labelPlacement" property to control where the label is placed relative to the select. Use this if you need to render a label with custom HTML.
36
+
*
35
37
* @part placeholder - The text displayed in the select when there is no value.
36
38
* @part text - The displayed value of the select.
37
39
* @part icon - The select icon container.
40
+
*
38
41
*/
39
42
@Component({
40
43
tag: 'ion-select',
@@ -122,6 +125,10 @@ export class Select implements ComponentInterface {
122
125
123
126
/**
124
127
* The visible label associated with the select.
128
+
*
129
+
* Use this if you need to render a plaintext label.
130
+
*
131
+
* The `label` property will take priority over the `label` slot if both are used.
125
132
*/
126
133
@Prop()label?: string;
127
134
@@ -566,7 +573,7 @@ export class Select implements ComponentInterface {
566
573
* TODO FW-3194
567
574
* Remove legacyFormController logic.
568
575
* Remove label and labelText vars
569
-
* Pass `this.label` instead of `labelText`
576
+
* Pass `this.labelText` instead of `labelText`
570
577
* when setting the header.
571
578
*/
572
579
letlabel: HTMLElement|null;
@@ -576,7 +583,7 @@ export class Select implements ComponentInterface {
576
583
label=this.getLabel();
577
584
labelText=label ? label.textContent : null;
578
585
}else{
579
-
labelText=this.label;
586
+
labelText=this.labelText;
580
587
}
581
588
582
589
constinterfaceOptions=this.interfaceOptions;
@@ -649,6 +656,30 @@ export class Select implements ComponentInterface {
0 commit comments