diff --git a/core/package-lock.json b/core/package-lock.json index f0ad1230b8..b3066b5b2e 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -14,9 +14,9 @@ } }, "@stencil/core": { - "version": "0.7.22", - "resolved": "https://registry.npmjs.org/@stencil/core/-/core-0.7.22.tgz", - "integrity": "sha512-DKZU73P6DaWA58sIWiu1jlSY6KBjRaOl3xzQjDFjktoQWZTNgC0mZLExTbPp21CaqsVmyGJjDxnQzy+Ja931fg==", + "version": "0.7.23", + "resolved": "https://registry.npmjs.org/@stencil/core/-/core-0.7.23.tgz", + "integrity": "sha512-12gdCOmVWt1zqo3q757mlWCnSHvJGJNuc8Sxv1YvRfzhzoGjJNPzjBabpTODQXAGRvvblbyCbwrIqyYC1qyM+A==", "dev": true, "requires": { "chokidar": "2.0.3", diff --git a/core/package.json b/core/package.json index 44aadb0e93..bf282f3f73 100644 --- a/core/package.json +++ b/core/package.json @@ -24,7 +24,7 @@ "ionicons": "4.0.0-19" }, "devDependencies": { - "@stencil/core": "0.7.22", + "@stencil/core": "0.7.23", "@stencil/dev-server": "latest", "@stencil/sass": "0.0.3", "@stencil/utils": "latest", diff --git a/core/src/components.d.ts b/core/src/components.d.ts index 1391dd83dd..791481ad8b 100644 --- a/core/src/components.d.ts +++ b/core/src/components.d.ts @@ -3013,7 +3013,7 @@ declare global { /** * The position determines where and how the label behaves inside an item. Possible values are: 'inline' | 'fixed' | 'stacked' | 'floating' */ - 'position': 'inline' | 'fixed' | 'stacked' | 'floating' | undefined; + 'position': 'fixed' | 'stacked' | 'floating'; } } @@ -3051,7 +3051,7 @@ declare global { /** * The position determines where and how the label behaves inside an item. Possible values are: 'inline' | 'fixed' | 'stacked' | 'floating' */ - 'position'?: 'inline' | 'fixed' | 'stacked' | 'floating' | undefined; + 'position'?: 'fixed' | 'stacked' | 'floating'; } } } diff --git a/core/src/components/label/label.tsx b/core/src/components/label/label.tsx index b5ceee951f..a85f24ef73 100644 --- a/core/src/components/label/label.tsx +++ b/core/src/components/label/label.tsx @@ -32,7 +32,7 @@ export class Label { * The position determines where and how the label behaves inside an item. * Possible values are: 'inline' | 'fixed' | 'stacked' | 'floating' */ - @Prop({mutable: true}) position: 'inline' | 'fixed' | 'stacked' | 'floating' | undefined; + @Prop() position?: 'fixed' | 'stacked' | 'floating'; /** * Emitted when the styles change. @@ -44,28 +44,24 @@ export class Label { return this.el.textContent || ''; } - componentWillLoad() { - if (this.position === undefined) { - this.position = (this.mode === 'ios') ? 'inline' : 'floating'; - } - } - componentDidLoad() { this.positionChanged(); } @Watch('position') positionChanged() { + const position = this.position; return this.ionStyle.emit({ - [`label-${this.position}`]: true, + [`label-${position}`]: !!position, }); } hostData() { + const position = this.position; return { class: { - [`label-${this.position}`]: true, - [`label-${this.mode}-${this.position}`]: true + [`label-${position}`]: !!position, + [`label-${this.mode}-${position}`]: !!position } }; }