Skip to content

Preview crashes the editor (intermittent) #35807

Closed

Description

@chad1008

Description

Under certain conditions, the preview can crash the editor when previewing mobile/tablet and then switching back to desktop.

This isn't consistent and in my tests seems to happen most often when the post content is empty, but there may be more nuance to it than that.

note: much of this issue is copied from @worldomonation's original here

Step-by-step reproduction instructions

  1. start a new post.
  2. add title.
  3. press tab to move to the body of the post.
  4. click on Preview button.
  5. click on Mobile or Tablet.
  6. click on Desktop.

Screenshots, screen recording, code snippet

137811345-40a8a34c-defd-4d32-b352-5d935ef987a4.mov
137812376-bd3f6939-adcd-40d7-a438-797e16f6242c.mov

Environment info

Reproducable on Mozilla Firefox, Microsoft Edge, and Google Chrome. I've personally tested and reproduced on Chrome 94.0.4606.81.

Tested on Gutenberg 11.7.0, but git bisect indicates it was introduced back in #33342

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

Activity

  1. added
    [Type] Bug
    on Oct 20, 2021
  2. Mamaduka commented on Oct 21, 2021

    @Mamaduka
    Member

    I was able to reproduce the issue, and it's mostly consistent when using reproduction steps.

    Details

    Uncaught TypeError: Cannot read properties of null (reading 'removeEventListener')
        at packages/components/src/popover/index.js:459
    

    if ( anchorDocument && anchorDocument !== ownerDocument ) {
    anchorDocument.defaultView.removeEventListener(
    'resize',
    refresh
    );
    anchorDocument.defaultView.removeEventListener(
    'scroll',
    refresh,
    true
    );
    }

    Screenshot

    CleanShot 2021-10-21 at 09 45 36

  3. Mamaduka commented on Oct 21, 2021

    @Mamaduka
    Member

    I've somewhat a naive solution for this issue, but I will give it a go 😄

    I am assigning this issue to myself for now.

  4. self-assigned this
    on Oct 21, 2021
  5. added
    [Status] In Progress
    on Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

[Package] Components[Status] In Progress[Type] Bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions