Remove unneccessary scrollbar from iFrame
See original GitHub issueHi there,
we just added viewport to our storybook. Everything works fine except we always have a scrollbar in our stories.
At the moment, I believe this is because of the following line where scrolling is set to yes on the iframe tag:
If I go to …/node_modules/@storybook/ui/dist/components/preview/iframe.js and change scrolling to no in the render function the scroll bar disappears:
return _react["default"].createElement(StyledIframe, _extends({
scrolling: "no",
id: id,
title: title,
src: src,
allowFullScreen: allowFullScreen
}, rest));
I can then easily define and control my desired scrolling behavior e.g. via a custom decorator in main.js if required.
Versions we use: “@storybook/preset-create-react-app”: “^1.5.2”, “@storybook/react”: “^5.3.19”, “@storybook/addon-viewport”: “^5.3.19”,
Any feedback on this issue would be much appreciated.
P.S. By the way, scrolling option on iframe is deprecated according to MDN: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:8 (8 by maintainers)
Top GitHub Comments
Boo-yah!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.1.0-alpha.0 containing PR #12223 that references this issue. Upgrade today to try it out!
You can find this prerelease on the
@next
NPM tag.@ndelangen Here is the tiny pull request: https://github.com/storybookjs/storybook/pull/12223