Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled exception rendering component: TypeError: Cannot read properties of null (reading 'removeChild') [Bug] #71

Open
Meoqan opened this issue Feb 9, 2024 · 2 comments
Labels
Resolved: Won't Fix The reported behaviour will not be changed.

Comments

@Meoqan
Copy link

Meoqan commented Feb 9, 2024

Describe the bug
If the Quill is used in nested subelements and attempts to use GetHTML it will throw an error.

To Reproduce
Steps to reproduce the behavior:

  1. Use Quill in a sub-element: EditorPage > SubFragment(List) > Quill Editor
  2. When saving, the content is read out with GetHTML (async)
  3. an error appears in the console: Unhandled exception rendering component: TypeError: Cannot read properties of null (reading 'removeChild')

Hosting Model (is this issue happening with a certain hosting model?):

  • Blazor WebAssembly
@Meoqan Meoqan added Bug Something isn't working Triage Issue needs to be triaged labels Feb 9, 2024
@ADefWebserver
Copy link
Collaborator

The reason I don't consider this a bug is that the component is not able to reach the required HTML element on the page, because of the nesting. This is definitely a limitation in how the component can be used, but, not a bug.

@Meoqan
Copy link
Author

Meoqan commented Feb 9, 2024

The editor works even if it is used nested.
I found the cause of the problem:

@if (!hide)
{
  <BlazoredTextEditor @ref="QuillNative" Placeholder="">
      <EditorContent>
          @((MarkupString)@NewNewsArticleItem.Text) <!-- gets updated, when the variable is set, but fails to update -->
      </EditorContent>
  </BlazoredTextEditor>
}
string txt = await QuillNative.GetHTML();  // works fine
hide = !hide;
NewNewsArticleItem.Text = txt; // causes error

The problem can be solved by simply hiding the editor immediately after the HTML has been fetched and before it is then written to the variable.

@ADefWebserver ADefWebserver added Resolved: Won't Fix The reported behaviour will not be changed. and removed Bug Something isn't working Triage Issue needs to be triaged labels Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolved: Won't Fix The reported behaviour will not be changed.
Projects
None yet
Development

No branches or pull requests

2 participants