peterpeterparker/stylo

When typing Japanese, line breaks are automatically inserted.

Closed this issue · 11 comments

Expected Behavior

When Japanese is converted from hiragana to kanji and the enter key is pressed, the character is confirmed and the rest of the sentence can be entered.

Actual Behavior

Pressing the enter key to convert from hiragana to kanji automatically breaks the line.

Reproduction

Steps to reproduce the issue:

1.Type Hiragana
2.Convert to Kanji with Space key
3.Fix the word with Enter key

Screenshots

2022-05-16.17.08.49.mov

Environment

  • Browser(s):
  • Operating System (e.g. Windows, macOS, Ubuntu):
    -MacBook Pro (13-inch, M1, 2020) mac OS Big Sur 11.6.1(20G224)
    ※I've tried with Android(Pixel6), It didn't reappear, no problem.

@HWRDWLWZ is following a particular plugin or it uses a feature of the browser?
if native, what browser and what OS?

the error happens when you press space right?
can you give me a list of keys that can lead to the issue?

i tried to reproduce the issue with chrome and the chrome input tools but wasn't able to reproduce it.

thanks in advance for the details

Capture d’écran 2022-05-16 à 20 33 18

@peterpeterparker
Browser is google chrome.

The issue is the create New line happens when typed Enterkey.

(in video, I found another issue that is word goes duplicate automatically when type word because of word suggest in Mac native function.)

Which Chrome version?
Windows or Mac?

As you can see in following capture, I write gibberish but enter key is working with the Google Inputs tool.

I need to find a way to replicate the same settings as you have and try to see why it propagate the "enter" event.

For some reason in your setting the enter keys of the type assist are bubbling to the content editable - i.e. are catched here https://github.com/papyrs/stylo/blob/1b283a43a97a2717a4925320320165147dd01e46/src/events/enter.events.ts#L31

ezgif com-gif-maker (1)

I've tried again, still no luck. What version of Chrome are you using?

also look like the Google inputtool I'm using doesn't look exactly the same as the one in above video so maybe something different there that does not help reproducing the issue.

Long story short, if someone who speak japanese can help debugging this, it would be helpful!

@hideto0118 will give a hand debugging this. I'll prepare a branch with some debugging information and hideto0118 will try to reproduce the error and collect some info

Pressing the enter key to convert from hiragana to kanji automatically breaks the line.

Are you pressing "enter" only or are you pressing "shift + enter" or another combination?

In OpenChat they have implemented a feature "Enter key sends message" for the same reason I think. I'll try to see what they implemented.

I deployed a potential fix, can you give it a try @HWRDWLWZ and let me know if it works out (🤞)?

It works!! Thank you!

Test20220605.mov

@peterpeterparker

Yoohoo! I'm so happy to hear that 🥳.

It was tricky to understand what was going wrong on and did not knew about the keyCode 229.

Thanks a lot for the help and feedback @HWRDWLWZ 🙏