HTML stories misrender in canvas
See original GitHub issueDescribe the bug When Storybook first loads in a set of HTML stories in Canvas, the one selected on initial page load renders properly. The first story you navigate to afterward renders the raw HTML. Navigating away and back to it a second time, it renders properly.
To Reproduce Steps to reproduce the behavior:
- Run an HTML Storybook with multiple stories
- Load Storybook in the browser
- Click a story other than the initial one
- Observe the raw HTML
- Navigate to any other story and back to the problematic one
- Observe it renders properly
Expected behavior Stories render properly regardless of when/how you arrive at them.
Screenshots
Code snippets
...
## Base alert
<Preview>
<Story name='Base alert'>{`
<div class="alert" role="alert">
<span class="alert__icon">...</span>
${text('Alert text', 'Hello World', 'base')}
</div>
`}</Story>
</Preview>
## Info alert
<Preview>
<Story name='Info alert'>{`
<div class="alert alert--info" role="alert">
<span class="alert__icon">...</span>
${text('Alert text', 'Info', 'info')}
</div>
`}</Story>
</Preview>
System:
Environment Info
<div> System:
OS: macOS Mojave 10.14.5
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Binaries:
Node: 12.4.0 - ~/.nvm/versions/node/v12.4.0/bin/node
npm: 6.13.4 - ~/.nvm/versions/node/v12.4.0/bin/npm
Browsers:
Chrome: 79.0.3945.88
Firefox: 71.0
Safari: 12.1.1
npmPackages:
@storybook/addon-a11y: ^5.3.0-rc.0 => 5.3.0-rc.0
@storybook/addon-docs: ^5.3.0-rc.0 => 5.3.0-rc.0
@storybook/addon-knobs: ^5.3.0-rc.0 => 5.3.0-rc.0
@storybook/addon-storysource: ^5.3.0-rc.0 => 5.3.0-rc.0
@storybook/html: ^5.3.0-rc.0 => 5.3.0-rc.0
@storybook/react: ^5.3.0-rc.0 => 5.3.0-rc.0
@storybook/source-loader: ^5.3.0-rc.0 => 5.3.0-rc.0
</div>
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
The Future Web: Will Canvas Rendering Replace the DOM?
There's been a lot of hand-wringing recently about Google's decision to use the HTML <canvas> for all of its rendering in Google Docs....
Read more >GDI ClearType rendered to RGBA surfaces sometimes looks ...
I want D3D and GL to support component alpha in transparent layers with text. See bug 593604 and bug 593733. That would fix...
Read more >Rendering HTML elements to <canvas> - Stack Overflow
It will render html element using creating SVG images. For Example: There is <em>I</em> like <span style="color:white; text-shadow:0 ...
Read more >What is another word for palter? - WordHippo
beg the question · tell stories · tell untruths · be economical with the truth ... misrender · meddle with · mess about...
Read more >Part 1 - Creating new technologies for endangered languages
As you have access to this content, full HTML content is provided on this page. ... The corpus aligns versions of the same...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@daneah thank You for this comment. I did almost the same, and your explanation led me to my own bug 😃
Oh, I spoke slightly too soon and it looks like this is a big d’oh on our part. I tried uninstalling
@storybook/react
, which led me to an unexpected import of it inside our HTMLpreview.js
…switching that to the expected@storybook/html
import seems to have everything working properly. Funny that it mostly worked except for that 😂 I’m closing this!