-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Text inside of DocPage stories can be selected but can not be copied. #18611
Comments
+1, facing the same issue here: https://react.fluentui.dev/?path=/docs/theme-color--page |
It seems this behavior is intentional... see #15559. I feel that "feature" is both unintuitive and surprising. In my opinion, it's should be an opt-in feature or be assigned to a safe and unused shortcut key. |
Agree with @pocka. 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 😬 It would be great to make this optional, as it just doesn't suit some use cases |
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. |
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: |
#18611 This patch introduces skip conditional for the "copy code snippet by shortcut key" feature. this condition would not work when the preview is iframe (user sets `docs: { inlineStories: false }`), but that does not matter as the event handler won't run in the first place.
Yo-ho-ho!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.0-beta.27 containing PR #19788 that references this issue. Upgrade today to the
Closing this issue. Please re-open if you think there's still more to do. |
Can we get a fix for this in non storybook 7? for those who can't upgrade? |
Just want to echo the prior poster's request. Upgrading for us is not tenable in the near future, largely due to lack of developer resources available to migrate our bespoke clojurescript -> js -> storybook build setup. It would be lovely to have this fixed in v6. Any guidance as to how to maybe monkeypatch this ourselves would also be appreciated if anyone has any! |
I'm willing to send a patch to v6 release but that release channel seems to be unmaintained? So here is a workaround: a patch for v6.5.16 generated using
|
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 theDocs
tab and not theCanvas
tab.Here's a video:
https://user-images.githubusercontent.com/49811/183597174-c04353ba-54a0-4ea2-b617-1c45e7533484.mp4
The text was updated successfully, but these errors were encountered: