Skip to content
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

Copy/paste handler not working in RichText component in block #53422

Closed
t-hamano opened this issue Aug 8, 2023 · 4 comments · Fixed by #54301
Closed

Copy/paste handler not working in RichText component in block #53422

t-hamano opened this issue Aug 8, 2023 · 4 comments · Fixed by #54301
Assignees
Labels
[Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable [Priority] High Used to indicate top priority items that need quick attention [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@t-hamano
Copy link
Contributor

t-hamano commented Aug 8, 2023

Description

If there is a RichText component in a block, such as caption text, the copy/paste handler does not seem to work on that RichText.

  • This problem is not reproduced when the block itself is a RichText component, such as a paragraph block.
  • I have tested on Windows OS and this problem occurs in Chrome and not in Firefox.
  • This problem occurs when the latest Gutenberg is enabled.

It would be great if you could test this issue, especially on MacOS, as the results may vary depending on the OS and browser.

Step-by-step reproduction instructions

  • Insert a block that contains a RichText component.
  • Enter text in the RichText component. For example, the caption in the Image block, cells, and caption in the Table blocks, etc.
  • Press the Ctrl + C key. Here, the text should be saved to the clipboard.
  • Press the Ctrl + V key elsewhere. In certain browsers, the text should not be pasted.

Screenshots, screen recording, code snippet

bdfac779fc632dfba235c4c1a5dfdb96.mp4

Environment info

  • Gutenberg version: 16.4.0-rc.1
  • Browser:
    • Chrome 115.0.5790.171: This problem occurs
    • Firefox 115.0.3: This problem does not occur

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended [Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable labels Aug 8, 2023
@t-hamano
Copy link
Contributor Author

t-hamano commented Aug 8, 2023

I used git bisect and tracked down the issue to where it was caused by #48254. I would like to explore the cause further.

@t-hamano
Copy link
Contributor Author

t-hamano commented Aug 8, 2023

Perhaps we should check to see if the problem reported in #48040 has been resolved on all OS/browsers before resolving this issue.

@stokesman
Copy link
Contributor

I tested on macOS and could reproduce the problem in Chrome, Safari, Orion, Firefox.

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Aug 9, 2023
@ellatrix ellatrix added the [Priority] High Used to indicate top priority items that need quick attention label Aug 19, 2023
@mrfoxtalbot
Copy link

This issue came up in the support forums and I can reproduce this with WP 6.3 and the Gutenberg plugin active (Version 16.5.0). A few more details I noticed:

  • The bug is not present when the plugin is deactivated. WP 6.3 on its own works fine
  • If the text is unformatted, the pasting works.
  • if the "paste as plain text" is used, it works too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable [Priority] High Used to indicate top priority items that need quick attention [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
4 participants