question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Text inside of DocPage stories can be selected but can not be copied.

See original GitHub issue

Describe the bug Text inside of DocPage stories can be selected but can not be copied.

To Reproduce Can be seen here:

I asked on Discord if this was a known issue and @kylegach discovered the issue exists on the above 3 instances.

I first noticed this in a private storybook instance running on @storybook/react v6.5.4 but it appears the the above 3 instances as well.

Additional context Tested on Mac in Chrome, Firefox, and Safari. Text cannot be copied through conventional means (cmd+c or right click and select “Copy” from context menu) but I noticed it’s still possible to use navigator.clipboard.writeText()

EDIT (2022-08-09) Just to clarify. Rendered text/code inside of code preview blocks appears to be manually selectable and copy-able (in addition to the Copy button still functioning fine. This bug report is about the text content within the rendered stories themselves. This also appears to only affect the Docs tab and not the Canvas tab.

Here’s a video: https://user-images.githubusercontent.com/49811/183597174-c04353ba-54a0-4ea2-b617-1c45e7533484.mp4

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
andyfordcommented, Aug 9, 2022

It seems this behavior is intentional… see #15559.

I’m not 100% sure… You can still manually select and copy rendered text inside of the code blocks. But you can’t copy text in the rendered stories. Maybe it is somehow related… but maybe not? 🤷

EDIT: After making a video (which I’ve added to the original post) and watching it back, I noticed that when I copy text from the rendered story (around 0:13 to 0:17), the UI temporarily says Copied in the bottom right corner. So this is could indicate that this bug is somehow tied to the source code copying functionality as @pocka suggested.

0reactions
andyfordcommented, Aug 9, 2022

I’m taking care of a design system done in storybook and I’m getting plenty of complaints from developers who can’t copy e.g. color codes or spacing values from DocPages

That’s exactly how I discovered this issue! In this case we implemented our own copy-to-clipboard functionality, but we shouldn’t have to do this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Copy Text That Can't be Copied on a Website - wikiHow
1. Turn off JavaScript if the right-click menu is disabled. If you can't right-click the page, see an alternative right-click menu, or get...
Read more >
DocsPage - Storybook - JS.ORG
It aggregates your stories, text descriptions, docgen comments, args tables, and code examples into a single page for each component. The best practice...
Read more >
2022 How to Copy Text That Cannot be Copied - EaseUS
The exact texts will be highlighted. Follow the highlighted texts and drag your mouse to select all the texts you need, and select...
Read more >
Copy and paste text styles in Pages on Mac - Apple Support (IE)
You can paste text styles from one Pages document to another. If the document where you paste the style doesn't have the style,...
Read more >
Prepare text for Word import feature in BookSmart - Help Center
We can only import .doc files, so please save your .docx file in .doc ... Adjust your .doc page size: 5" x 8"...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found