Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When typing Japanese, line breaks are automatically inserted. #83

Closed
HWRDWLWZ opened this issue May 16, 2022 · 11 comments
Closed

When typing Japanese, line breaks are automatically inserted. #83

HWRDWLWZ opened this issue May 16, 2022 · 11 comments

Comments

@HWRDWLWZ
Copy link

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.
@peterpeterparker
Copy link
Owner

@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

@HWRDWLWZ
Copy link
Author

HWRDWLWZ commented May 16, 2022

@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.)

@peterpeterparker
Copy link
Owner

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)

@peterpeterparker
Copy link
Owner

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!

@peterpeterparker
Copy link
Owner

@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

@peterpeterparker
Copy link
Owner

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?

@peterpeterparker
Copy link
Owner

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.

@peterpeterparker
Copy link
Owner

peterpeterparker commented Jun 5, 2022

We should try ckeditor/ckeditor5#5750 (comment)

i.e. handling keyCode event 229 and not adding paragraph when it is sent

select2/select2#2482 (comment)
https://lists.w3.org/Archives/Public/www-dom/2010JulSep/att-0182/keyCode-spec.html

@peterpeterparker
Copy link
Owner

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

@HWRDWLWZ
Copy link
Author

HWRDWLWZ commented Jun 5, 2022

It works!! Thank you!

Test20220605.mov

@peterpeterparker

@peterpeterparker
Copy link
Owner

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 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants