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

Duplicate Task Creation When Hitting Enter with Korean Input on Google Chrome #301

Open
uyu423 opened this issue Aug 1, 2024 · 7 comments

Comments

@uyu423
Copy link

uyu423 commented Aug 1, 2024

Description

Hello.
I am a user from South Korea.

When creating a task using Korean input and hitting enter, the task gets created multiple times.
This issue might also occur with other input methods similar to Korean, such as Chinese and Japanese.
However, moving the cursor more than once or using the "ADD" button to create the task does not result in this issue.
Testing in Safari browser showed normal behavior without any issues.
I am attaching a screenshot for reference.

ps) When a task is duplicated, one is created exactly as entered, and the other is created with the last character omitted.

Thank you.

Test:

Input Korean Text (title: "한글이 두번 입력되는 이슈 테스트")
image

Duplicate creation HTTP request
image
image

Result
image

Vikunja Version

v0.24.1

Browser and version

Google Chrome 127.0.6533.73 (arm64)

Can you reproduce the bug on the Vikunja demo site?

Yes

Screenshots

No response

@dpschen
Copy link
Contributor

dpschen commented Aug 7, 2024

Unsure where this is originated.
Could this be an issue with text segmentation? If so Intl.Segmenter might help. Aka use Intl.Segmenter instead of split(' ').

@kolaente
Copy link
Member

kolaente commented Aug 7, 2024

I was unable to reproduce this when copying the Korean text from the original comment into the task input and pressing enter. This may indicate the bug has something to do with the keyboard layout, not necessarily with Korean letters.

@dpschen maybe we should add that and check if the issue is gone after that?

@dpschen
Copy link
Contributor

dpschen commented Aug 7, 2024

I was able to reproduce.
It did work in the overview. But in a project list view you will end up with two tasks.

@uyu423
Copy link
Author

uyu423 commented Aug 8, 2024

Thank you for your passionate technical support.

The way to reproduce @kolaente 's issue is probably because the copied text is in a different cursor activation state. I guess the issue is reproduced only when directly inputting.

@dpschen In my case, it is reproduced in both the overview and project list views.

Is there anything you can check to help me with this issue? If you tell me where to set the debug point and create the task, I can check it ! (although my knowledge of the frontend is limited)

@kolaente
Copy link
Member

My best guess right now is this has something to do with the multiline input (you can enter multiple lines of text and it will create a task for each line). If that's the case, using Intl.Segmenter as suggested by dpschen should fix it. I'll take a look.

@kolaente
Copy link
Member

Here's where we split:

https://github.com/go-vikunja/vikunja/blob/main/frontend/src/helpers/parseSubtasksViaIndention.ts#L21

It looks like that should work since \r\n is the same regardless of the input text language.

AFAIK to properly use Intl.Segmenter we'd need to detect the language of the input, which isn't really possible that easily (and overkill for the problem at hand).

@dpschen do you have an idea how to debug this further?

@dpschen
Copy link
Contributor

dpschen commented Aug 12, 2024

Maybe try out the following: assume the written text is in the users language (even if that’s not the case). For segmentation the result might still be better than splitting by space. Eg. afaik emojis shouldn’t make problems.

If it doesn’t solve the problem I would reverse it.

@kolaente kolaente added the bug Something isn't working label Sep 13, 2024
@kolaente kolaente removed the bug Something isn't working label Jan 22, 2025
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

3 participants