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

[BUG] NGX-EDITORJS - ApplicationRef.tick is called recursively #27

Open
mikeciz opened this issue Jun 16, 2021 · 0 comments
Open

[BUG] NGX-EDITORJS - ApplicationRef.tick is called recursively #27

mikeciz opened this issue Jun 16, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@mikeciz
Copy link

mikeciz commented Jun 16, 2021

Which Library?
ngx-editorjs

Describe the bug
I've got the library up and running perfect. In my HTML, I have the following:
<ngx-editorjs *ngIf="isEditing" #ngxEditorJS [holder]="holder" [blocks]="data"></ngx-editorjs>

I'm utilizing a slide-toggle to enable/disable editing of the form. There's a separate div which displays the "read-only" version since I didn't see a way to set ngx-editorjs to a read-only mode.

I can enable the editor perfectly. The read-only version goes away via an *ngIf and the ngx-editorjs initializes as expected. My issue is when I then go and click the toggle to disable editing. When I do that, the ngx-editorjs goes away as expected, however, I get the following error:
ApplicationRef.tick is called recursively at ApplicationRef.tick
and from line 272 of the function destroyInstance
(https://github.com/tanepiper/ngx-tinynodes/blob/4a77f6e2a70f793c22ef249b810463a598d05e0b/libs/ngx-editorjs/ngx-editorjs/src/lib/services/editorjs.service.ts)

To Reproduce
Steps to reproduce the behavior:

  1. Add an *ngIf to the component
  2. Toggle the view of the component to remove it from the DOM

Expected behavior
I think this is happening because the function to destroy is being run during a change detection cycle. I would assume that the this.ref.tick() may not be necessary in this situation, however, perhaps it's needed in other instances. A try/catch would be nice at a minimum?!

Desktop (please complete the following information):

  • OS: OSX
  • Browser Chrome

Additional context
Thanks for this library! It really made it easy to add EditorJS to my angular app!

@mikeciz mikeciz added the bug Something isn't working label Jun 16, 2021
@mikeciz mikeciz changed the title [BUG] <Library Name - Version>: Description [BUG] NGX-EDITORJS - ApplicationRef.tick is called recursively Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants