IgniteUI / ignite-ui

Ignite UI for jQuery by Infragistics

Home Page:https://bit.ly/2kuu1fT

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

igDateEditor: Value is not correct when it is entered from a keypad on an Android device.

mkamiishi opened this issue · comments

Description

Value is not correct when it is entered from a keypad on an Android device.

Steps to reproduce

  1. Open the attached sample html with Chrome on an Android device.
  2. Tap inside the editor.
  3. Enter 201801011200 from the key pad.
  4. Tab outside the editor to focus out.

Result

The editor shows 2018/10/12/00:09.

Expected result

The editor should show 2018/01/01/12:00.

Attachments

igDateEditor_.zip

Further information for future reference:

  1. The issue has to do with two quirks of Android software keyboards handling of old-school key events.
    Firstly, there's a known issue where the soft keyboard will not generate proper event details (all key codes being 229) which completely disables controls such as mask/date editors as we can't enforce the mask. See https://bugs.chromium.org/p/chromium/issues/detail?id=118639 (Status: WontFix, due to IME issues)
    Next - the saving grace of soft keyboards thus far was they always entered through composition (IME) even in English, even for numbers. Composition is something we can and do handle in bulk at the end of edit.
    Lastly, it seems newer versions of Android/keyboards have stopped entering composition mode, leaving us back to the first bit and the result of this issue.

  2. The fix applied is a workaround with the assumption that if the mask has literals, the value entered will not match its length, as we have no other meaningful way to detect this behavior. That means the fix will help with most common cases, but still if the value entered exceeds the required value with extra characters equal to the literals in the mask, the value process might still fail.
    At this point, this is the best solution we can come up with, short of rewriting the editors or asking the user to attach a bluetooth keyboard to their phone :)