TypeError: Cannot read properties of null (reading 'getContent')

Aperta
#83 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
html
Ambito
frontend

Direzione di ricerca

The issue points to updateTinyVal and dynamically rendered <Editor> components in a Blazor list. Start by tracing how the wrapper gets the TinyMCE instance when an item is added; reproduce the failure with AddItemToListOfItems and compare it with the working loop. Done means adding an item no longer triggers the null getContent error and existing editor binding still works.

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

Descrizione

bug status: escalated

Specific code that throws the error:

const updateTinyVal = (id, val) => { if (getTiny() && getTiny().get(id).getContent() !== val) { getTiny().get(id).setContent(val); } };

Happens when i try to build it dynamically e.g.

This works:

foreach (var item in listOfItems)
{
    <Editor @bind-Text="item.Text"/>
}

This doesnt:

<Button OnClick="AddItemToListOfItems"/>
foreach (var item in listOfItems)
{
    <Editor @bind-Text="item.Text"/>
}

Not sure why.

Lingua principale
HTML
Stelle
57
Fork
17
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

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 tinymce/tinymce-blazor

Tutte le issue di tinymce/tinymce-blazor

Issue simili

Altre issue su Web Dev

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.