Make the viewport addon compatible with composition.

This commit is contained in:
Jeroen Zwartepoorte 2022-12-15 15:52:32 +01:00
parent 970fc0d841
commit 4623dd7283

View File

@ -58,7 +58,6 @@ const toLinks = memoize(50)((list: ViewportItem[], active: LinkBase, set, state,
.filter(Boolean); .filter(Boolean);
}); });
const iframeId = 'storybook-preview-iframe';
const wrapperId = 'storybook-preview-wrapper'; const wrapperId = 'storybook-preview-wrapper';
interface LinkBase { interface LinkBase {
@ -208,7 +207,7 @@ export const ViewportTool: FC = memo(
<ActiveViewportSize> <ActiveViewportSize>
<Global <Global
styles={{ styles={{
[`#${iframeId}`]: { [`iframe[data-is-storybook="true"]`]: {
margin: `auto`, margin: `auto`,
transition: 'width .3s, height .3s', transition: 'width .3s, height .3s',
position: 'relative', position: 'relative',