Skip to content
This repository was archived by the owner on Nov 22, 2021. It is now read-only.

add on space|comma not respected on Galaxy S7, Nexus 6P, and Nexus 9 #770

Closed
calebfaruki opened this issue Jan 18, 2017 · 6 comments
Closed

Comments

@calebfaruki
Copy link

Problem devices: Galaxy S7, Nexus 6P, and Nexus 9

Here is how I am invoking the directive:

<tags-input name="emails"
  ng-model="edVm.emails"
  type="email"
  display-property="email"
  placeholder="Enter email addresses"
  min-tags="1" max-tags="10"
  add-on-space="true"
  add-on-comma="true"
  add-on-blur="true"
  replace-spaces-with-dashes="false"
  allowed-tags-pattern="^[\w+\-.]+@[a-z\d\-]+(\.[a-z]+)*\.[a-z]+$"></tags-input>

However, if I hit the return button on the keyboard, it will register the email as a tag. But when I type commas or spaces, nothing happens. This does not affect other Android versions.

@triforcely
Copy link

I can confirm this issue exists on Xiaomi Mi4C running Android 6.0.1 (CyanogenMod 13) using Crosswalk as runtime for hybrid application. User-agent: "Mozilla/5.0 (Linux; Android 6.0.1; Mi-4c Build/MHC19Q) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Crosswalk/22.52.561.4 Mobile Safari/537.36"

@triforcely
Copy link

Looks like #692 resolves the issue for commas. This approach probably won't work for spaces unless ngTrim is set to false for the input field.

@calebfaruki
Copy link
Author

The library does automatically sets the ngTrim parameter to false. However, the bug still happens on these devices. I manually patched the library to include the fix from the PR you referenced. But the issue still persists. @YouCantTriforce

Did you have any luck with these devices at all?

@triforcely
Copy link

I didn't have time to look into it yet. Once I get into fixing this issue I'll definitely post my observations here.

@calebfaruki
Copy link
Author

calebfaruki commented Mar 9, 2017

I've identified the issue as being related to the keyCode value 229. When using a physical keyboard connected to an emulator, the 229 key code does not occur.

But if you use the software keyboard of the Android device, emulator or real device, the 229 key code event happens for ANY key pressed.

https://lists.w3.org/Archives/Public/www-dom/2010JulSep/att-0182/keyCode-spec.html

Here is a screenshot of the keydown event object.
screen shot 2017-03-09 at 2 52 17 pm

EDIT: I tried modifying the library to use the keyup event instead of the keydown event. I was able to capture the actual key code from the Samsung software keyboard. However, the user can still type whatever they want, despite the input field validity being set to false. That new effect happened on all devices.

I'm going to give up on trying to fix this for now. But I hope this helps someone else create a fix for it.

http://stackoverflow.com/questions/17139039/keycode-is-always-zero-in-chrome-for-android

@mbenford
Copy link
Owner

This issue was selected to be spring-cleaned by a script. More information can be found here.

If anyone thinks this was a mistake and this issue should be reopened, please leave a message below explaining why. Before doing so, please consider reading the CONTRIBUTING file.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants