Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/global/DocDemo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const DocDemo = (props) => {
})}
title={`Toggle ${mode === 'ios' ? 'iOS' : 'Android'} mode`}
onClick={() => setIonicMode(mode)}
key={mode}
>
{mode === 'ios' ? 'iOS' : 'Android'}
</button>
Expand Down
18 changes: 10 additions & 8 deletions src/components/global/Playground/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -567,36 +567,38 @@ export default function Playground({
</div>
{renderIframes
? [
<div className="playground__preview">
<div className="playground__preview" key="preview">
{!iframesLoaded && renderLoadingScreen()}
{/*
We render two iframes, one for each mode.
When the set mode changes, we hide one frame and
show the other. This is done to avoid flickering
and doing unnecessary reloads when switching modes.
*/}
We render two iframes, one for each mode.
When the set mode changes, we hide one frame and
show the other. This is done to avoid flickering
and doing unnecessary reloads when switching modes.
*/}
{devicePreview
? [
<div className={!isIOS ? 'frame-hidden' : 'frame-visible'} aria-hidden={!isIOS ? 'true' : null}>
<div key="ios-iframe" className={!isIOS ? 'frame-hidden' : 'frame-visible'} aria-hidden={!isIOS ? 'true' : null}>
<device-preview mode="ios">
<iframe height={frameSize} ref={(ref) => handleFrameRef(ref, 'ios')} src={sourceiOS}></iframe>
</device-preview>
</div>,
<div className={!isMD ? 'frame-hidden' : 'frame-visible'} aria-hidden={!isMD ? 'true' : null}>
<div key="md-iframe" className={!isMD ? 'frame-hidden' : 'frame-visible'} aria-hidden={!isMD ? 'true' : null}>
<device-preview mode="md">
<iframe height={frameSize} ref={(ref) => handleFrameRef(ref, 'md')} src={sourceMD}></iframe>
</device-preview>
</div>,
]
: [
<iframe
key="ios-iframe"
height={frameSize}
className={!isIOS ? 'frame-hidden' : ''}
ref={(ref) => handleFrameRef(ref, 'ios')}
src={sourceiOS}
aria-hidden={!isIOS ? 'true' : null}
></iframe>,
<iframe
key="md-iframe"
height={frameSize}
className={!isMD ? 'frame-hidden' : ''}
ref={(ref) => handleFrameRef(ref, 'md')}
Expand Down