Skip to content

The cursor moves to the beginning of the text when using a keyboard shortcut #482

@jissepo

Description

@jissepo

What is the current behavior?
This seems to be specifically an issue caused by this wrapper, since it is not reproducible in the tinymce fiddle environment.

The issue is that when the editor has a v-model value then the content gets "refreshed" on some actions:

Cursor_jump.mov
  1. Write text and add space at the end (the space is important)
  2. Use shortcut (CTRL + B, CTRL + U or CTRL + I)
  3. Write text
    ???
  4. Cursor jumps to the beginning of the editor

Please provide the steps to reproduce and if possible a minimal demo of the problem.:

https://codesandbox.io/p/devbox/dazzling-albattani-27yf8g

What is the expected behavior?

Cursor stays at the same location.

Which versions of TinyMCE, and which browser / OS are affected by this issue? Did this work in previous versions of TinyMCE or tinymce-vue?

Atleast:
"@tinymce/tinymce-vue": "^6.3.0",
"vue": "^3.5.22",

Chromium based browsers.

Pretty sure it used to work at some point :D

When v-model is removed, and one variable is used for "initial content", which is passed to the :model-value, and a event listener is added to the @update:model-value event to update the "main data variable" then it works.
But it is very counter intuitive to have to use a variable for initial content and another for actually storing the data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions