diff --git a/packages/core/src/components.d.ts b/packages/core/src/components.d.ts
index 52cf434d10..f509d64930 100644
--- a/packages/core/src/components.d.ts
+++ b/packages/core/src/components.d.ts
@@ -1135,6 +1135,7 @@ declare global {
mediaQuery?: string;
mode?: string;
or?: boolean;
+ orientation?: string;
platform?: string;
size?: string;
}
@@ -2906,6 +2907,7 @@ declare global {
mediaQuery?: string;
mode?: string;
or?: boolean;
+ orientation?: string;
platform?: string;
size?: string;
}
diff --git a/packages/core/src/components/show-when/readme.md b/packages/core/src/components/show-when/readme.md
index 55cc543fad..9d836547e3 100644
--- a/packages/core/src/components/show-when/readme.md
+++ b/packages/core/src/components/show-when/readme.md
@@ -22,6 +22,11 @@ string
boolean
+#### orientation
+
+string
+
+
#### platform
string
@@ -49,6 +54,11 @@ string
boolean
+#### orientation
+
+string
+
+
#### platform
string
diff --git a/packages/core/src/components/show-when/show-when.tsx b/packages/core/src/components/show-when/show-when.tsx
index 4f674e7b34..3d2c195705 100644
--- a/packages/core/src/components/show-when/show-when.tsx
+++ b/packages/core/src/components/show-when/show-when.tsx
@@ -1,9 +1,9 @@
-import { Component, Element, Prop } from '@stencil/core';
+import { Component, Element, Listen, Prop, State } from '@stencil/core';
import { Config, PlatformConfig } from '../../index';
import {
DisplayWhen,
- componentWillLoadImpl,
+ updateTestResults,
} from '../../utils/show-hide-when-utils';
@Component({
@@ -16,16 +16,18 @@ export class ShowWhen implements DisplayWhen {
@Prop({ context: 'config' }) config: Config;
@Prop({ context: 'platforms' }) calculatedPlatforms: PlatformConfig[];
+ @Prop() orientation: string = null;
@Prop() mediaQuery: string = null;
@Prop() size: string = null;
@Prop() mode: string = null;
@Prop() platform: string = null;
@Prop() or = false;
- passesTest = false;
+ @State() passesTest = false;
+ @Listen('window:resize')
componentWillLoad() {
- return componentWillLoadImpl(this);
+ return updateTestResults(this);
}
hostData() {
diff --git a/packages/core/src/components/show-when/test/basic/index.html b/packages/core/src/components/show-when/test/basic/index.html
index 35fa1b4c0a..ff9c38a580 100644
--- a/packages/core/src/components/show-when/test/basic/index.html
+++ b/packages/core/src/components/show-when/test/basic/index.html
@@ -29,8 +29,17 @@