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

Đang mở
#482 7 bình luận 2 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Start with the tinymce-vue wrapper behavior around v-model updates; the issue’s CodeSandbox demo provides a reproduction. Check whether the cursor jump occurs after the listed keyboard shortcuts, then compare with the issue’s alternative :model-value and @update:model-value setup. Done means the cursor stays in place with v-model after the shortcut and subsequent typing.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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:

https://github.com/user-attachments/assets/07bd6d2d-2519-4438-91ef-45ad458d06e7

  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.

Ngôn ngữ chính
TypeScript
Star
2.2k
Fork
217
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của tinymce/tinymce-vue

Tất cả issue của tinymce/tinymce-vue

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.