nick-keller / react-datasheet-grid

An Airtable-like / Excel-like component to create beautiful spreadsheets.
MIT License
1.81k stars 171 forks source link

Error typing in Korean.(Duplicate character issue) #204

Closed devourer3 closed 1 year ago

devourer3 commented 2 years ago

Hello. Keller, I think this library is very useful and good. Thank you very much for providing a good library. I'm inquiring because there seems to be one issue. There is no problem if type it in English in TextColumn, but if type it in Korean, the last letter is copied and attached to the front. Regarding the problematic part, I am attaching the video.

https://user-images.githubusercontent.com/30230285/202879808-8d0c6911-81bf-4431-9101-fa4405edf43a.mov

nick-keller commented 2 years ago

Thanks for the feedback, could you link some resources about the issue? I don't have access to a Korean keyboard and would like to know how to reproduce. The strange thing is the it uses a basic input underneath... I need to dig into it.

devourer3 commented 2 years ago

Thanks for the feedback, could you link some resources about the issue? I don't have access to a Korean keyboard and would like to know how to reproduce. The strange thing is the it uses a basic input underneath... I need to dig into it.


Thank you for your response!

Regarding the error, it seems to be an issue occurring in three East Asian countries (Chinese, Korean, and Japanese).

Here's how to cause the problem: "안녕하세요" After inputting, press 'Enter', it occurs. Also, pressing the Tab key does not cause character duplication, but it has the same effect as pressing the tab twice.

Unlike English, East Asian languages (Chinese, Korean, and Japanese) are letters that combine consonants and vowels. I think this is related to the onKeyDown event in the input tag of TextColumn.

When the onKeyDown event occurs, please check whether event.isComposing is present or not and process it. (When typing Korean, Chinese, or Japanese, e.isComposing is true.)

I think it would be good to refer to this. https://developer.mozilla.org/en-US/docs/Web/API/InputEvent/isComposing

https://levelup.gitconnected.com/javascript-events-handlers-keyboard-and-load-events-1b3e46a6b0c3