Custom inline content not updating in the document

Offen
#2,142 7 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Muss geklärt werden
Aktivitätsstatus
Veraltet
Tech-Stack
react, typescript
Bereich
frontend

Rechercherichtung

Reproduce the issue from the linked StackBlitz and start in src/App.tsx, focusing on the inserted custom_tag, its contentRef usage, and the export button. Compare how initialContent and newly inserted inline content are represented in the exported JSON. Done means edited inserted custom inline content is retained in the exported document, with the editable-content behavior documented.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

bug:P2

Describe the bug
When inserting a simple custom inline content, updating the text in the editor is visible, but if you try to reteive the document from the editor the custom inline content is empty.

To Reproduce
Use the slash command to insert a tag, click the red tag, type some letters. Hit the export button, you'll see the JSON update and the content of the custom_tag type of content is alway empty

{
    "id": "9e1fc163-eb41-4e6a-9d27-08985f84d248",
    "type": "paragraph",
    "props": {
      "backgroundColor": "default",
      "textColor": "default",
      "textAlignment": "left"
    },
    "content": [
      {
        "type": "text",
        "text": "fsffs ",
        "styles": {}
      },
      {
        "type": "custom_tag",
        "props": {},
        "content": []
      }
    ],
    "children": []
  },

stackblitz link

Question

What am I doing wrong? The docs around editable custom inline content is really thin. Took a while to work out I needed a ref pointing to the content ref on an element for the content to be shown ref={props.contentRef}. But cannot for the life of me figure out how to make these editable and exportable

It's curious that if you edit an initialContent tag it will update the document with the content, but if you insert a new one, it won't grab the content from the new inline content.

Misc

  • Node version:
  • Package manager:
  • Browser:
  • I'm a sponsor and would appreciate if you could look into this sooner than later 💖
Vorherrschende Sprache
TypeScript
Sterne
10.2k
Forks
772
Ø Merge
3 T. 11 Std.
Gemergte PRs (30 T.)
17

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus TypeCellOS/BlockNote

Alle Issues in TypeCellOS/BlockNote

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.