LinkControl crashing block in Pattern Editor #65874
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
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:Here's the error with
SCRIPT_DEBUG
set totrue
Step-by-step reproduction instructions
Steps to Reproduce
Create a Pattern with a block that contains a
LinkControl
Open Pattern Editor
Open the Pattern with the LinkControl
All I know is that the error is caused by the
useCopyToClipboard
hook inside used byLinkPreview
component internally inLinkControl
.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.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
UPDATE:
The issue appears after WP 6.5. Before that the example block doesn't crash in the Pattern Editor.
The text was updated successfully, but these errors were encountered: