jackocnr/intl-tel-input

Windows Phone IE doesn't support keypress event

ianmurrays opened this issue · 2 comments

Hello, thanks for a great library! I'm trying to implement this in Windows Phone 8 IE and I've discovered that the keypress event never fires, thus breaking the auto format feature. I've been trying to find a quick solution to this problem but the only viable one appears to be using the keydown event instead of keypress.

Just wanted to report this in case anyone else stumbles across this. I'm working on a solution and I hope to create a pull request if I find a simple way to handle this.

Hi, I'm glad you like the plugin.

Yes it's tricky - I don't think keypress is actually a standardised event, but I think you will struggle to reproduce the same autoFormat functionality with just keydown, mostly because keydown relates directly to a physical keyboard key, and so there's lots of complication around if meta keys (like ctrl/shift) are pressed at the same time etc (as opposed to keypress, which relates to the character produced).

There are similar problems in Chrome for Android (see issue 56), but luckily these issues are now being fixed. Do you know if there are bug reports for the keypress event in the Windows mobile browser? If there are, it would be great if you could post link(s) here so we can keep track.

I couldn't find any official documentation for JavaScript key event support in IE Mobile, let alone a public bug tracker, so instead I'll just post a few links I found to people complaining that key events don't work, and no-one coming up with a solution...

Windows Mobile 6.5 Internet Explorer OnKeyPress Not Exposed
OnKeyPress - IE Mobile
OnKeyPress workaround for IE Mobile
Mask doesn't update on Windows 8 mobile or Blackberry playbook

As a result of this, I'm disabling autoFormat for IE Mobile. And with no way of knowing if they'll ever add support for this, I'm closing the issue.