Skip to content

Trix no longer adds dataset attributes on inserted attachments in 2.1.4 #1178

Open
@J-Michalek

Description

@J-Michalek

Describe the bug or issue here…

Steps to Reproduce
  1. Go to https://trix-editor.org/
  2. Delete all of the content
  3. Paste the following code into the console and run it
(() => {
    const trix = document.querySelector("trix-editor");
    const attachment = new Trix.Attachment({
    "attachment-type": "custom",
    "content": "<div data-item-id='123'>Content</div>",
    "contentType": "custom"
    });

    trix.editor.insertAttachment(attachment)
})()
  1. Inspect the attachment within Trix and see that the div element is missing the data-item-id attribute

This was working fine prior to version 2.1.4.

Details
  • Trix version: 2.1.4
  • Browser name and version: Chrome 127.0.6533.89 (Official Build) (arm64)
  • Operating system: MacOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions