Skip to content

[P2] Spoiler block: Copy/pasting two back-to-back spoiler blocks causes script to hang #62692

Open

Description

Issue initially reported (here) by @dpasque, but had to refile as the report was transferred to a private repo and couldn't be moved back to a public one.

Quick summary

If you have two spoiler blocks back to back, select them both and copy in a published P2 post, and then try to paste elsewhere in a P2 editor, your webpage with freeze up with an unresponsive script! There seems to be some kind of infinite loop or hang on the main thread.

Steps to reproduce

  1. Write a P2 post
  2. Write two spoiler blocks back to back. Put a header and some content in each.
  3. Post the post.
  4. Highlight the two spoiler blocks while collapsed.
  5. cmd+c to copy
  6. In an editor somewhere (like a comment on that very post), try to cmd+p paste.

What you expected to happen

The blocks to paste.

What actually happened

The main thread locks up!

Context

The very P2 post I found this (has good data to reproduce): pciE2j-QC-p2

Simple, Atomic or both?

Simple, Atomic

Theme-specific issue?

It's O2 blocks, so specific to P2!

The spoiler block is in the Calypso repo:
https://github.com/Automattic/wp-calypso/tree/1089ff50ac29fde828fbcbfc90e40101cd1e343d/apps/o2-blocks/src

Browser, operating system and other notes

Chrome

Reproducibility

Consistent

Severity

Some (< 50%)

Available workarounds?

Yes, easy to implement

Workaround details

You can just copy one at a time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions