RobinHerbots / Inputmask

Input Mask plugin
https://robinherbots.github.io/Inputmask/
MIT License
6.4k stars 2.17k forks source link

(Japanese IME)Appear repeated number when bluring from the feild after entered 123 in Japanese IME #2662

Closed IsabellaGao12 closed 1 year ago

IsabellaGao12 commented 2 years ago

now I use the <input data-inputmask="'mask': '99999999999'" /> to get the effect of phone number, I entered 123 and then blur from this filed in Japanese IME, the double 123 can appear in the field. but if I just press the Enter from this field, that is fine.

inputMask version: 5.0.8-beta.47-0 Browser: Chrome

the attached file is my test screenshot

https://user-images.githubusercontent.com/101157677/199468495-8d15d292-8181-487d-b3b7-dd9ed5cfa992.mp4

KathleenLu1 commented 2 years ago

@RobinHerbots Could you please help check this issue?

RobinHerbots commented 2 years ago

Hi @IsabellaGao12 , @KathleenLu1 ,

I installed the simplefied chinese ime (Microsoft pinyin) and put the character on full width. That seems to work just fine.

Maybe is it due to the IME. Which do you use exactly? How can I install it to have a try.

KathleenLu1 commented 2 years ago

we used Japanese IME on windows system. Could you please help check it? Thanks! In below link: https://github.com/RobinHerbots/Inputmask/issues/1606 wesleywong Have same issue, but not found solution. Thanks for the reply. yeah, by this code i can type in full width character just that it will double up the character when i enter. e.g. "1" = "11"

RobinHerbots commented 2 years ago

@KathleenLu1 ,

Can you have a try with the latest version on github. I made a fix for the double entry.

Best regards, Robin

IsabellaGao12 commented 2 years ago

@RobinHerbots Thanks for your help. I have tried the latest version, now the issue that mentioned in my description is fine, but when I input 0 by Japanese IME, can appear double 0, other numbers are fine but 0. Could you help to check this again? Thanks a lot. double 0 issue

RobinHerbots commented 2 years ago

Hi @IsabellaGao12 ,

I've submitted another fix. Can you have a try. (With enter you can confirm the composition. )

KathleenLu1 commented 2 years ago

@KathleenLu1 ,

Can you have a try with the latest version on github. I made a fix for the double entry.

Best regards, Robin

Thank you so much! I'll have a try!

IsabellaGao12 commented 2 years ago

Hi @RobinHerbots Thank you for helping us. I have tested the latest version(5.0.8-beta.50), now the two issues I mentioned have been fixed, but I find another one issue that the value will be empty when I press the Enter key after input some numbers by Japanese IME as below test screenshot, actually this issue is fine in version(5.0.8-beta.49), Could you help to check this? Thank you very much! enter issue

RobinHerbots commented 2 years ago

@IsabellaGao12 ,

And when you select the value?

IsabellaGao12 commented 2 years ago

@IsabellaGao12 ,

And when you select the value? @RobinHerbots for example, when I input 1234 by Japanese IME and then directly press Enter Key, the fields's content is cleared, the right should be keep the entered value. (5.0.8-beta.50)

RobinHerbots commented 2 years ago

Can you do some debugging for me?

Before you press enter you put a breakpoint in the inputFallBackEvent function.

I would like to see the stacktrace and maybe you can step through and see what happens.

You will see something like if (p !== d && (void 0 === e.inputType || "insertCompositionText" !== e.inputType)) {

What is the value of p, d and e.inputType

IsabellaGao12 commented 2 years ago

@RobinHerbots first screenshot: my operation steps: input 1 first, and then directly blur from this field by clicking blank area. second screenshot: input 1 first, and then press enter track track2

RobinHerbots commented 2 years ago

One more thing.

In the keypressevent function.

You will see at the end c.isComposing && (h.trigger("input"), c.isComposing = !1));

Is the input event triggered in case when typing enter. (that's why I needed the stacktrace.)

IsabellaGao12 commented 1 year ago

Hi @RobinHerbots I tracked the code, the input event or change event cannot be triggered when I press the Enter first time, but I continue to press the Enter second time, the event can be triggered. so if I only press Enter key once and then blur, the field's value can be cleared, but if I press Enter key twice, the value is fine.

RobinHerbots commented 1 year ago

@IsabellaGao12 , @KathleenLu1 ,

Can you have a try with the latest version. I created some kind of hack for the japanese ime.

IsabellaGao12 commented 1 year ago

@RobinHerbots I will have a try with the latest version, Thank you very much for your help