Skip to content

text-editor: HTML serialization moves the cached live img element out of the editor #4170

Description

@john-traas

The image node's success-state toDOM (src/components/text-editor/prosemirror-adapter/plugins/image/node.ts) returns the cached HTMLImageElement instance itself. HTMLConverter.serialize runs DOMSerializer.serializeFragment and appends the result to a detached container — relocating that shared live element. Serializing twice, or any clipboard serialization, mutates state shared with the rendered editor. toDOM returning a clone (or an array spec) for serialization contexts would avoid this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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