mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[GH-ISSUE #2039] [bug]: 参数无法填写中文 使用搜狗输入法会把拼音和中文都添加上 #666
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#666
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @maidou883 on GitHub (Dec 23, 2021).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/2039
Is there an existing issue for this?
Current behavior
输入中文时会把拼音也输入上去


Steps to reproduce
1.打开hoppscotch
2.填写参数
3.使用输入法填写中文
4.会出现拼音也输入上去
Environment
Release
Version
v2.1.0 Latest
@liyasthomas commented on GitHub (Dec 23, 2021):
@maidou883, what I've understood is: "Parameters cannot be filled in Chinese. Using Sogou input method will add both Pinyin and Chinese."
Since I don't have access to Chinese or Pinyin input tools, I am afraid I can't reproduce this behavior at my end.
Let me know if this behavior is true to all input fields in Hoppscotch or just for Parameters?
@maidou883 commented on GitHub (Dec 23, 2021):
@liyasthomas Try to fill in other parameters, you will encounter the same problem.

The correct approach should be to retain only Chinese, not Pinyin (English letters).
Using the input field here should solve this problem.
@liyasthomas commented on GitHub (Dec 23, 2021):
May I know if this happens in other input fields like
URL,Headerssections etc?@maidou883 commented on GitHub (Dec 23, 2021):
@liyasthomas
URL,HeadersSame error.All positions that can be entered are this error.
I don't know if the same error will occur in other languages.
This error occurs when you enter Chinese, It is OK to enter English only.
Changing the div tag to the input tag should fix this bug.
@liyasthomas commented on GitHub (Dec 23, 2021):
@maidou883 I can't find any evidence of why this is happening. Hoppscotch doesn't have any such functions to auto-translate/parse any of the user's inputs. Either this got something to do with your browser (any 3rd party extensions maybe?) or your input tool.
I am afraid I can't provide any help with the behavior I cannot reproduce at my end. Moreover, I haven't received any such bug reports from our users.
Let me know if you can reproduce this issue on any other device just to confirm it got something to do with Hoppscotch.
May I know what this component is:
@maidou883 commented on GitHub (Dec 23, 2021):
@liyasthomas
It's OK to enter Chinese in Google and GitHub, but hopscotch can't. I can't input it when I open it on other computers. You can find a Chinese who should help you reproduce your mistakes.
@maidou883 commented on GitHub (Dec 23, 2021):
@liyasthomas

The content in the red box is redundant. When I input the content in the green box, I will automatically fill in the content in the red box. I only need the content in the green box, not the content in the red box
@maidou883 commented on GitHub (Dec 24, 2021):
Why use div instead of input here?
@liyasthomas commented on GitHub (Dec 24, 2021):
Native
inputfields don't support enabling features like style for environments etc.@maidou883 commented on GitHub (Dec 24, 2021):
I'll send you an email and a video later. You'll see the recurrence of the error.
@maidou883 commented on GitHub (Dec 24, 2021):
@liyasthomas The mail has been sent successfully.
Title Recurrence error.
@zsxeee commented on GitHub (Dec 24, 2021):
Reproduced with Microsoft IME with Chinese and Japanese.


@liyasthomas commented on GitHub (Dec 24, 2021):
I've not received the mail. You can share the video here in comments or send it to support@hoppscotch.io
@liyasthomas commented on GitHub (Dec 24, 2021):
I'd appreciate if you can give proper steps to reproduce it.
@maidou883 commented on GitHub (Dec 24, 2021):
Sent successfully support@hoppscotch.io
@zsxeee commented on GitHub (Dec 24, 2021):
If you are using Windows, you can add a keyboard with:
Windows Settings | Time & Language | Language | Add a Language | Search & select "Chinese(Any)" or "Japanese"
Change keyboard with
Win + Space, then input with "中" mode in Chinese or "あ"/"ア" mode in Japanese.Use shift switch mode in Chinese.
@liyasthomas commented on GitHub (Dec 24, 2021):
cc @AndrewBastin can you check if it's reproducible at your end? Refer above steps.
If it's reproducible, then it got something to do with the
EnvInputcomment and the way we parse UTF-8 characters in it.@kidonng commented on GitHub (Dec 28, 2021):
I was about to report the same issue and almost ignored this one due to its title being written in Chinese but for I can read it.
Back to the topic, this seems to be related to the fact that
<SmartEnvInput>does some transformation to its input. This interferes with IMEs which expect the inputed text to stay as-is.The solution would be checking
KeyboardEvent.isComposingand making transformations only after the user finishes inputting.@kidonng commented on GitHub (Dec 28, 2021):
FYI, CJK IMEs are not required to reproduce the bug. Regular IMEs on mobile should be able to trigger it pretty easily.
This is how the prediction/pre-edit/composition should look like normally:
https://user-images.githubusercontent.com/44045911/147529525-37406a43-ce3b-46af-ab78-6f40a72ffd87.mp4
In
<SmartEnvInput>, the prediction is interruptted and resumed on every keystroke, and it can even result in inputted texts being duplicated:https://user-images.githubusercontent.com/44045911/147529692-110ca73d-1d6f-4761-b2d8-0dff5aa796e4.mp4
@AndrewBastin commented on GitHub (Dec 28, 2021):
@kidonng thank you for the detailed info!
The EnvInput system is a bit complex system so this might take a bit of time to get fixed.
Meanwhile will a toggle setting to disable EnvInput suffice for the meantime ? (cc: @liyasthomas)
Also, we would really love help if you are able to fix it as I personally don't have experience working with IMEs.
@liyasthomas commented on GitHub (Jan 6, 2022):
It would be great if you can test this deploy preview and see if the error persists or not: https://deploy-preview-2057--hoppscotch.netlify.app
cc: @maidou883, @zsxeee, @kidonng
@zsxeee commented on GitHub (Jan 6, 2022):
LGTM on Microsoft IMEs
@kidonng commented on GitHub (Jan 7, 2022):
Late for replying but unfortunately I was busy and didn't got the time to submit a fix myself.
The related PR works great, however one issue still remains: backspace key on IMEs can still be funky:
https://user-images.githubusercontent.com/44045911/148494668-7e0f693d-da80-491f-b5d8-0a1f4897d37d.mp4