Entering CJK with Placeholder causes problems with the first character

If you enter CJK with placeholder set, the first character will be forcibly determined.

(Japanese is converted like this↓)

ko -> こ

If you want to enter

but

kこ

Will be entered.

1 Like

Same thing happened to Chinese input. The first character typed in Chinese is forced into the corresponding english character.

For instance to type “你” in Chinese you will need to type “ni” but when placeholder is set, the letter “n” will be the english character

1 Like

recording:
placeholder-issue

tested with

"@codemirror/view": "^0.19.39",

Chrome Version 97.0.4692.71 (Official Build) (arm64)
Mac OS 12.0

@marijn sorry for bumping this. Could you advise for a workaround if possible?

appreciate any pointers :hugs:

This patch should help with this problem:

1 Like

Deeply appreciate it! Thank you Marjin :heartpulse:

Just noticed the new <img class="cm-widgetBuffer"> breaks the caret and its position in empty editors with placeholder texts.

Basically, the caret gets its own line, isn’t positioned correctly and doesn’t have the proper height. Applying display: inline to .cm-widgetBuffer fixes the first problem, but leaves the incorrect height and positioning of the caret. Once a single letter is typed, caret looks fine again.

Edit: If I hard-code the height of .cm-widgetBuffer I can make the caret look like before. This seems rather hacky, though. Would love to apply height: 100% but this doesn’t work for some reason.

The cursor looks normal to me in Firefox and Chrome. Please open a github issue with a more precise description of the problem (this thread is about something else).