ueberdosis / tiptap

The headless rich text editor framework for web artisans.
https://tiptap.dev
MIT License
27.31k stars 2.28k forks source link

[Bug]: Cannot enter full-width characters correctly after toggleBold on Nuxt #5079

Open y-negishi opened 6 months ago

y-negishi commented 6 months ago

Which packages did you experience the bug in?

core, extension-bold, pm, vue-3

What Tiptap version are you using?

2.3.0

What’s the bug you are facing?

  1. editor.chain().focus().toggleBold().run()
  2. Enter full-width characters (ex: あ) 3 times
  3. input ああああ

What browser are you using?

Chrome

Code example

https://stackblitz.com/edit/nuxt-starter-hu71q3?file=package.json,app.vue,nuxt.config.ts

What did you expect to happen?

If you type three times, it should be あああ, but one more character has been typed. The cursor position seems to have changed after toggleBold. This happens not only with toggleBold, but also with toggleItalic, setBold, and unsetBold. It also happens with full-width English (A) characters as well as kana characters such as .

Anything to add? (optional)

No response

Did you update your dependencies?

Are you sponsoring us?

y-negishi commented 6 months ago

I downgraded the version of prosemirror-view from 1.33.4 to 1.32.7 explicitly in package.json and it works fine. I do not know if this is a TipTap issue, Prosemirror issue, Nuxt issue or otherwise.

devunt commented 6 months ago

Also happens in Korean characters. Composition of Hangul characters are broken after v2.3.0.

devunt commented 6 months ago

This seems most likely caused by https://github.com/ProseMirror/prosemirror-view/commit/a2af570ec12da0ac74cb98a3ca15c3b5b2411055. Downgrading prosemirror-view to 1.33.2 solves the issue.

I've created the issue on their side: https://github.com/ProseMirror/prosemirror/issues/1458, too.

Lwrless commented 5 months ago

This was fixed three weeks ago in prosemirror-view 1.33.5 (https://github.com/ProseMirror/prosemirror-view/commit/ab8fa82fc72163298f39a811d2edf530882a534a), so I think we should now be able to upgrade to a later version of prosemirror-view.

y-negishi commented 2 months ago

Upon rechecking, this problem also occurred in 2.6.4. Specifying the version of prosemirror-view resolves the issue.