TypeError: Cannot read properties of null (reading 'getContent')
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- html
- Domain
- frontend
Research direction
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.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- HTML
- Stars
- 57
- Forks
- 17
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tinymce/tinymce-blazor
-
status: escalated
Difficulty 1/5 Under an hour Newbie friendliness 42/100
tinymce/tinymce-blazor#89 · 3 comments · 7 reactions ·
-
Clarity on ScriptSrcOpendocumentation GitHub status: escalated
Difficulty 1/5 Under an hour Newbie friendliness 35/100
tinymce/tinymce-blazor#70 · 4 comments · 1 reaction ·
-
Editor not loadingOpenGitHub
Difficulty 3/5 1-2 days Newbie friendliness 35/100
tinymce/tinymce-blazor#59 · 8 comments ·
-
Debounce/delayOpenenhancement GitHub
Difficulty 4/5 3-5 days Newbie friendliness 28/100
tinymce/tinymce-blazor#58 · 2 comments ·
-
GitHub help wanted
Difficulty 4/5 3-5 days Newbie friendliness 30/100
tinymce/tinymce-blazor#33 · 5 comments · 1 reaction ·
All issues in tinymce/tinymce-blazor
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
vetro-protocol/vetro-monorepo#1321 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Action playback and Record Again still open Convert to Frame with the old 1 to 300000 integer fields and no unit readingPossibly taken @Higgs32584 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
storytold/photocraft#20578 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bugfix
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day