Skip to content

[examples/mentions] Pasting or cutting a selected mention node crashes locally #10

@wudidewo12

Description

@wudidewo12

Description

In the Mentions example, copying and pasting a selected mention node, or cutting a selected mention node, crashes the local page. The live Slate example handles the same selected mention node normally.

I reproduced this with both @R2-D2 and @Mace Windu, so this appears to affect selected mention inline void nodes generally.

Recording

Screenshots attached below:

Local actual behavior:

Image

Live reference expected behavior:

Image

Video attached below:

Not required unless the screenshots are not clear enough.

Sandbox

No standalone sandbox. Reproduced in the Slate examples site.

Local reproduction URL:

http://localhost:3100/examples/mentions

Reference URL:

https://www.slatejs.org/examples/mentions

Steps

To reproduce the copy/paste crash:

  1. Go to http://localhost:3100/examples/mentions.
  2. Click an existing mention node, such as @R2-D2 or @Mace Windu, so that the mention is selected.
  3. Press Cmd+C.
  4. Move the caret to another position in the editor.
  5. Press Cmd+V.

Alternative cut path:

  1. Go to http://localhost:3100/examples/mentions.
  2. Click an existing mention node, such as @R2-D2 or @Mace Windu, so that the mention is selected.
  3. Press Cmd+X.

Expectation

The selected mention node should copy/paste or cut successfully, matching the live Mentions example.

  • Cmd+C then Cmd+V should insert another copy of the selected mention node.
  • Cmd+X should remove the selected mention node from its original position.
  • The page should not crash.

Actual behavior

On the local Mentions example, copying then pasting a selected mention node crashes the page with a runtime error. Cutting the selected mention node also crashes.

Observed error:

Cannot read properties of null (reading 'setAttribute')

Environment

  • Local branch/commit: v2, ce2bd6c6
  • Local URL: http://localhost:3100/examples/mentions
  • Reference URL: https://www.slatejs.org/examples/mentions
  • Browser: Chrome on macOS

Impact

This breaks clipboard operations for mention inline void nodes and can crash the examples page during a normal editor copy/paste or cut workflow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions