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

InputNumber: can be cheated in order to enter symbols or letters #6324

Closed
AlvaroTKT opened this issue Apr 8, 2024 · 15 comments · Fixed by #6352 or leoo1992/GeradorQRCode#23
Closed
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@AlvaroTKT
Copy link

Discussed in https://github.com/orgs/primefaces/discussions/1597

Originally posted by AlvaroTKT April 4, 2024

Hello,

We've encountered a bug while implementing the InputNumber component from Prime React. It's possible to input non-numeric characters when typing double-tap characters (such as an accent "`").

Steps to reproduce : This issue can be reproduced using the library's component guide itself. If you focus on the component, type an accent, and then immediately type a letter, the component inserts that letter. At the event level, nothing is triggered (neither event nor e.value).

image

Is there any workaround, or is it indeed confirmed as a bug?

As @melloware points, It can be reproduced in primevue too.

image

@melloware melloware transferred this issue from primefaces/community Apr 8, 2024
@melloware melloware added the Type: Bug Issue contains a defect related to a specific component. label Apr 8, 2024
@github-actions github-actions bot added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Apr 8, 2024
@melloware melloware removed the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Apr 8, 2024
@melloware melloware changed the title InputNumber can be cheated in order to enter symbols or letters InputNumber: can be cheated in order to enter symbols or letters Apr 8, 2024
@FlipWarthog
Copy link
Contributor

@AlvaroTKT Can you elaborate on the specific steps you're taking and/or take a screen capture? I assumed you were talking about Alt code but I don't think that's what you mean and in my testing they are properly handled.

@AlvaroTKT
Copy link
Author

@AlvaroTKT Can you elaborate on the specific steps you're taking and/or take a screen capture? I assumed you were talking about Alt code but I don't think that's what you mean and in my testing they are properly handled.

No, I wasn't referring to the Alt codes. I've made a gif showing the process in real time and asking the program to detail the keys. Actually, what I do is quickly press the "`" key and then a letter. I can write with preloaded text, and I can do it in an empty input field as you can see.

primeReact

@melloware
Copy link
Member

@AlvaroTKT can you try again with 10.6.3 released today? I made some changes to InputNumber recently around keyboard support. Let us know if it is still happening.

@AlvaroTKT
Copy link
Author

@AlvaroTKT can you try again with 10.6.3 released today? I made some changes to InputNumber recently around keyboard support. Let us know if it is still happening.

I tested it in my app and in documentation.

image

It's still happening

@melloware
Copy link
Member

OK thanks for reporting back.

@melloware
Copy link
Member

Weird i am trying everything to reproduce and can't reproduce it. @FlipWarthog and I are on US based keyboards do you think that makes a difference?

@AlvaroTKT
Copy link
Author

AlvaroTKT commented Apr 9, 2024

Weird i am trying everything to reproduce and can't reproduce it. @FlipWarthog and I are on US based keyboards do you think that makes a difference?

I have a spanish keyboard

image

I don't know if this could be a key factor, but....

@melloware
Copy link
Member

I think it must be because our USA "`" tick key is not triggering this behavior. Can you do me a favor and go here: https://w3c.github.io/uievents/tools/key-event-viewer.html

Press your Accent key and paste the screenshot. Here is my Accent Key.

image

@AlvaroTKT
Copy link
Author

Here is the screenshot with the results:

image

I also add a gif with a suite of cases of tick key triggering. tick with consonant, tick with tick and tick with vowel for adding more info

kEventViewer

@melloware
Copy link
Member

Nice @FlipWarthog and I will study this. The code seems to be "Dead". I will look at how this can happen.

@FlipWarthog
Copy link
Contributor

@melloware https://en.wikipedia.org/wiki/Dead_key

I think we can use virtual keyboards in Windows set to Spanish or another language that has a Dead key for replicating this.

@melloware
Copy link
Member

Yeah from what i was reading it said change your Windows Keyboard to Spanish or Italian?

@FlipWarthog
Copy link
Contributor

Yup, from the Windows settings you can add a language. Once you have more than one installed it'll add a lang switcher to the taskbar in the bottom right.

image

This updates your keyboard layout and also updates the on-screen keyboard to match (so you can actually see what they keys are)

image

I was able to replicate the issue following these steps.

@melloware
Copy link
Member

OK PR submitted.

melloware added a commit to melloware/primereact that referenced this issue Apr 9, 2024
@AlvaroTKT
Copy link
Author

Thanks for the hard work ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
3 participants