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

Chips separator not working on mobile #3885

Closed
WMPerkele opened this issue Jan 2, 2023 · 14 comments · Fixed by #3901, #3911, #3914 or #3915
Closed

Chips separator not working on mobile #3885

WMPerkele opened this issue Jan 2, 2023 · 14 comments · Fixed by #3901, #3911, #3914 or #3915
Assignees
Labels
Device: Mobile Issue or pull request is *only* related to Mobile device Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@WMPerkele
Copy link

WMPerkele commented Jan 2, 2023

Describe the bug

When using the Chips component on mobile, the component does not recognize inputting the separator key.

Testing done on Opera for Android 12

PrimeReact version

8.1.1

React version

17.x

Language

ES6

Build / Runtime

Create React App (CRA)

@WMPerkele WMPerkele added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jan 2, 2023
@melloware
Copy link
Member

@WMPerkele a few questions...

  1. When you say separator is not working which key on Android are you pressing? I am just trying to get clear what key is NOT working.

  2. Can you go to this site and press the key that is not working and then paste the screenshot output here please? https://w3c.github.io/uievents/tools/key-event-viewer.html

I want to see what Android and Opera is registering for that key.

@melloware melloware added Type: Bug Issue contains a defect related to a specific component. Device: Mobile Issue or pull request is *only* related to Mobile device and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jan 2, 2023
@melloware melloware self-assigned this Jan 2, 2023
@melloware melloware added this to the 8.7.4 milestone Jan 2, 2023
melloware added a commit to melloware/primereact that referenced this issue Jan 2, 2023
@melloware
Copy link
Member

OK it because it was using the old keyboard event.which === 188 instead of event.code === 'Comma'

@WMPerkele
Copy link
Author

@WMPerkele a few questions...

  1. When you say separator is not working which key on Android are you pressing? I am just trying to get clear what key is NOT working.
  2. Can you go to this site and press the key that is not working and then paste the screenshot output here please? https://w3c.github.io/uievents/tools/key-event-viewer.html

I want to see what Android and Opera is registering for that key.

The separator key was the default which was comma (,). Pressing the same key on the site that you gave gives me keycode 229 so im not sure if that helps

@melloware
Copy link
Member

OK but on key.code it should say "Comma" right? For example:

image

@WMPerkele
Copy link
Author

It says "Undefined". Seems like this is an issue with onkeydown event and android devices

@melloware
Copy link
Member

Yikes that is bad as that means it doesn't conform to proper browser spec. I would report this to the Opera team.

@melloware
Copy link
Member

Actually what is the value of key is it , ?

@melloware
Copy link
Member

It seems Android supports event.key but not event.code.

@WMPerkele
Copy link
Author

Ive tested now on Opera, Chrome and Firefox for Android 12.

Opera and Chrome seem to both return keycode 229, the key is "Unindentified" and the data is ,

On firefox it returns keycode 188 correctly with key being , (comma). However if i try using the Chips component on your Primereact docs site (https://www.primefaces.org/primereact/chips) it still wont work or recognize the separator key

@melloware
Copy link
Member

melloware commented Jan 3, 2023

OK according to this event.key is available on all those browsers so it should be the value ,??

https://caniuse.com/?search=event.key

And event.code is not available except for Firefox on Android:

https://caniuse.com/?search=event.code

When I say key i mean this blue value

image

@WMPerkele
Copy link
Author

WMPerkele commented Jan 4, 2023

Screenshot from 2023-01-04 10-41-35
Here's the full screenshot

@melloware
Copy link
Member

Thanks this is a big help and will help me fix it. Do you mind sending me screenshots of BACKSPACE and ENTER key as well?

@WMPerkele
Copy link
Author

snapshot_w3c github io_1672827027416

melloware added a commit to melloware/primereact that referenced this issue Jan 4, 2023
@melloware
Copy link
Member

Thanks this was a big help. I had to put in a special check for this 229 character as its not a comma on any other OS other than Android and these browsers. Very strange

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Device: Mobile Issue or pull request is *only* related to Mobile device Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
2 participants