Custom inline content not updating in the document

Aperta
#2,142 7 commenti 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
react, typescript
Ambito
frontend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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 💖
Lingua principale
TypeScript
Stelle
10.2k
Fork
772
Merge medio
3g 11h
PR unite (30g)
17

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TypeCellOS/BlockNote

Tutte le issue di TypeCellOS/BlockNote

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.