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

LinkControl crashing block in Pattern Editor #65874

Open
2 tasks done
StYankov opened this issue Oct 4, 2024 · 0 comments
Open
2 tasks done

LinkControl crashing block in Pattern Editor #65874

StYankov opened this issue Oct 4, 2024 · 0 comments
Labels
[Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) Needs Testing Needs further testing to be confirmed. [Type] Bug An existing feature does not function as intended

Comments

@StYankov
Copy link

StYankov commented Oct 4, 2024

Description

The LinkControl component from the @wordpress/block-editor package does not work as expected when used inside the Pattern Editor. The block crashes with some JS errors in the console:
Image

Here's the error with SCRIPT_DEBUG set to true
Image

Step-by-step reproduction instructions

Steps to Reproduce

  1. Create a Pattern with a block that contains a LinkControl Image

  2. Open Pattern Editor

  3. Open the Pattern with the LinkControlImage

All I know is that the error is caused by the useCopyToClipboard hook inside used by LinkPreview component internally in LinkControl.
I tried installing the Gutenberg Plugin 19.3 but it still crashes.

Screenshots, screen recording, code snippet

I created a simple test repo with WP and a theme with block that contains a LinkControl to reproduce the issue: repo block edit.js

Environment info

WordPress Version: 6.6.2
Browser: Chrome 127

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

UPDATE:
The issue appears after WP 6.5. Before that the example block doesn't crash in the Pattern Editor.

@StYankov StYankov added the [Type] Bug An existing feature does not function as intended label Oct 4, 2024
@Mamaduka Mamaduka added Needs Testing Needs further testing to be confirmed. [Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) labels Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) Needs Testing Needs further testing to be confirmed. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

2 participants