You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Updating content externally causes cursor to jump to beginning #321
I'm updating an editor linked to a formControl through external means, and the cursor jumps to the beginning when an update is triggered. I don't experience this behavior using something like a basic textarea, or other directives like an Angular Material matInput on a textarea.
Please provide the steps to reproduce and if possible a minimal demo of the problem via [codesandbox.io]
Which versions of TinyMCE/TinyMCE-Angular, and which browser / OS are affected by this issue? Did this work in previous versions of TinyMCE or TinyMCE-Angular?
Seems to affect all browsers.
tinymce-angular@7.0.0
tinymce@6.2.0
The problem with situations like this is that completely different content might be coming from the pipeline and it is wild to magically place the caret where a user think it should be. So, of course every time the content changes is a clear slate and start from the beginning. At best, the component could do a best effort to place it in the same position if the content has not changed at all.
In my case it's because I have an autosave mechanism that saves every x seconds. The saving is done in the server and the saved content is sent back to the formControl which resets the cursor everytime.
I was upgrading from a simple textarea to tinymce and this is the main reason that I can't continue working on the tinymce integration. Would be nice to have a solution or workaround for this.
This issue is stale because it has been open 30 days with no activity. Please comment if you wish to keep this issue open or it will be closed in 7 days.
This issue is stale because it has been open 30 days with no activity. Please comment if you wish to keep this issue open or it will be closed in 7 days.
Can we please revisit this issue, as it gets annoying when used with DynamicFormControlComponent. It looks like TinyMCE already handles the update of the values, so there is a line of code that actually causes this issue, and it's not needed. I will be creating a pull request
Activity
exalate-issue-sync commentedon Oct 20, 2022
Ref: INT-3036
jscasca commentedon Oct 21, 2022
The problem with situations like this is that completely different content might be coming from the pipeline and it is wild to magically place the caret where a user think it should be. So, of course every time the content changes is a clear slate and start from the beginning. At best, the component could do a best effort to place it in the same position if the content has not changed at all.
andyrue commentedon Oct 21, 2022
Thanks for looking. That does make sense, but how come something like a textarea works as expected? This example has both.
https://codesandbox.io/s/tinymce-angular-forked-96s50w
ferlimputra commentedon Jun 30, 2023
I have the same issue.
In my case it's because I have an autosave mechanism that saves every x seconds. The saving is done in the server and the saved content is sent back to the formControl which resets the cursor everytime.
I was upgrading from a simple textarea to tinymce and this is the main reason that I can't continue working on the tinymce integration. Would be nice to have a solution or workaround for this.
davidediak commentedon Feb 7, 2024
This bug is annoying also me: opened a PR.
tiny-stale-bot commentedon Jul 9, 2024
This issue is stale because it has been open 30 days with no activity. Please comment if you wish to keep this issue open or it will be closed in 7 days.
tiny-stale-bot commentedon Aug 9, 2024
This issue is stale because it has been open 30 days with no activity. Please comment if you wish to keep this issue open or it will be closed in 7 days.
tiny-stale-bot commentedon Aug 16, 2024
This issue was closed because it has been stalled for 7 days with no activity.
ZeroRex0126 commentedon Aug 27, 2025
Can we please revisit this issue, as it gets annoying when used with DynamicFormControlComponent. It looks like TinyMCE already handles the update of the values, so there is a line of code that actually causes this issue, and it's not needed. I will be creating a pull request