Skip to content

The library doesn't work inside the iframed block editor in WordPress #693

@mrleemon

Description

@mrleemon

Describe the bug

I'm trying to use the library inside the iframed block editor in WordPress and I'm getting the following error:

react-dom.js?ver=18.3.1.1:22888 Uncaught Error: Panzoom should be called on elements that have been attached to the DOM

Your environment

  • Version of panzoom: 4.6.1
  • Browser and browser version: Firefox 147.0

Expected behavior

The library should work inside the iframed block editor without throwing an error.

Actual behavior

An error is thrown because the library relies on the global window or document:

react-dom.js?ver=18.3.1.1:22888 Uncaught Error: Panzoom should be called on elements that have been attached to the DOM

Steps to reproduce

Install and run the WordPress plugin found in: https://github.com/mrleemon/rather-simple-panzoom/

Possible fix

According the WordPress developers, to make the library work inside the iframed block editor, a small change should be made to the isAttached() function in:

WordPress/gutenberg#73138 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions