sibiraj-s / ngx-editor

🖋️ Rich Text Editor for angular using ProseMirror
https://sibiraj-s.github.io/ngx-editor/
MIT License
423 stars 182 forks source link

[Bug]: Ngx Editor Not Registering Input Value on Page Navigation #521

Open timoachtelik opened 2 months ago

timoachtelik commented 2 months ago

What happened?

Bug Description:

I am encountering an issue with the Ngx Editor where it fails to register input values after navigating away and then returning to the page where the editor is located.

Steps to reproduce:

Load the page with the Ngx Editor. Enter values into the editor. At this point, the form correctly captures these values. Navigate away from the page. Return to the page with the Ngx Editor.

Expected behavior: The editor should continue to register input values and the form should capture these values correctly.

Actual behavior:

The input value is not registered in the FormControl. Additionally, the placeholder text does not disappear when entering new text. Instead, the input value is written inside the placeholder in the DOM, giving the impression that the form is not fully functional.

This issue occurs consistently after the first navigation away from the page. The initial load of the page sometimes present this problem.

Environment: Ngx Editor version: 16.0.1 @nx/angular: 16.9.1, Node.js version: 18.18.0

I am looking for a solution or workaround to this issue. Any help would be greatly appreciated.

Version

16.0.1

Angular Version

16.9.1

What browsers are you seeing the problem on?

No response

Link to reproduce

No response

Relevant log output

No response

Willing to submit a PR?

None

hiepxanh commented 1 month ago

look like change detection issue, you can settimeout then use changeDetectRef.detectChanges()