jefago / tiny-markdown-editor

TinyMDE: A tiny, dependency-free embeddable HTML/JavaScript Markdown editor.
MIT License
96 stars 12 forks source link

Cannot input languages such as Chinese and Japanese. #58

Closed movsb closed 4 months ago

movsb commented 4 months ago

Tested both languages on Firefox, Chrome and Safari, on MacOS, none will work.

Possible reason: handleInput cannot deal with insertCompositionText for event.inputType.

jefago commented 4 months ago

what happens when you try to enter Chinese or Japanese? How can I reproduce this?

It shouldn't really have anything to do with handleInput, the input handling is handled by the browser by setting contentEditable to true on the editor element; handleInput just processes the already entered content...

movsb commented 4 months ago

If you are on MacOS, it's very simple to have an input method enabled, just goto the Keyboard settings and Add Input Methds, such as Chinese Simplfied.

What happens when I try to enter Chinese?

If that's not very clear though, I can capture some videos for you.

Not tested on Windows. For Safari on iPhone, things get worse.

jefago commented 4 months ago

Thanks. That should hopefully help me reproduce.

On Sat 11. May 2024 at 15:36, 桃子 @.***> wrote:

If you are on MacOS, it's very simple to have an input method enabled, just goto the Keyboard settings and Add Input Methds, such as Chinese Simplfied.

What happens when I try to enter Chinese?

-

For Firefox:

Press f(or any) and then hit Space to emit the first candidate, the content will be f\n instead of a Chinese word, and the console logs Uncaught TypeError: this.lineElements[e].removeAttribute is not a function..

For Safari:

Press f, it produces content ff, but the composition text is ok, If I hit Space now, the result will be ff我 (any Chinese word),and if I repeat, ff我ff我ff我。

For Chrome:

The same keystrokes above produces f f f f , instead of a Chinese word, a space will be inserted.

If that's not very clear though, I can capture some videos for you.

Not tested on Windows. For Safari on iPhone, things get worse.

— Reply to this email directly, view it on GitHub https://github.com/jefago/tiny-markdown-editor/issues/58#issuecomment-2105748982, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADNAAWTB5N45FFHI6T5W5LDZBYNFZAVCNFSM6AAAAABHRPD5DOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBVG42DQOJYGI . You are receiving this because you commented.Message ID: @.***>

jefago commented 4 months ago

This should be fixed in the latest release with PR #60. Let me know if you are still running into this.

movsb commented 4 months ago

Great, I see it fixed 🤘.

I run into another issue on pasting, see #61 .