morethanwords / tweb

Telegram Web K, GPL v3
https://web.telegram.org/k/
GNU General Public License v3.0
1.6k stars 489 forks source link

[BUG] Cannot use Vietnamese Character in first character of text line #316

Open huyhandes opened 2 months ago

huyhandes commented 2 months ago

Describe the bug The first character auto disappeard when type the Vietnamese text.

To Reproduce Steps to reproduce the behavior:

  1. Install any Vietnamese unicode app like: EVkey, JOKey, GoTiengViet, etc... and switch to Vietnamese mode
  2. Go to any chat
  3. Click on type message
  4. Type any text with unicode character like: Đ(DD), á(as), ơ(ow)
  5. The text disappeared

Expected behavior Well worked text as above

Desktop (please complete the following information):

Additional context This problem happen on many browsers and OSs. I think it's the Webk version problem. This issue not happen on WebA version.

specialgift45 commented 2 months ago

I had the same issue as above By typing the first character that had Vietnamese diacritics, the input content would disappear. This issue has been happening for months now.

NotEvenANeko commented 2 months ago

Same issue here. The input disappears if the first character is a Chinese character. And on my testing it only occurs on Chromium-based browsers (Edge 125 and Chrome 126), it won't happen on Firefox.

NotEvenANeko commented 2 months ago

Seems like the document.execCommand API has a weird implementation on Chromium-based browsers, so Web K mitigates it by resetting the textContent to empty string of the input element.

But if I input something with IME or external app on Chromium-based browsers, an input event with empty value is triggered just between typing and entering the final word, causing the resetting procedure triggered, and the input words are removed.