Pixabay/jQuery-autoComplete

Autocomplete position issue on Windows Phone 8.1

anilsharma83 opened this issue · 1 comments

Auto complete suggestion is not having correct position with respective control. attached image
windowsphone_autocomplete
This is happening with windowPhone 8.1 IE 11.
you can verify it with https://www.browserstack.com as real device experience

The problem is that when keyboard is active pageYOffset shows the real offset from screen, while everything else stays in a larger viewport that scrolls till it hits a border. Because of this getting absolute position with pageYoffset is not possible. The fix should go to jQuery. I patched it for myself with:
jQuery.fn.extend( {
offset: function( options ) {
...
top: box.top + (isWindowsPhone ? document.documentElement.scrollTop : win.pageYOffset) - docElem.clientTop,
left: box.left + (isWindowsPhone ? document.documentElement.scrollLeft : win.pageXOffset) - docElem.clientLeft

and at the top defined the variable as:
isWindowsPhone = navigator.userAgent.match(/Windows Phone/i),

It works on Windows phone 8.1. For others I do not know.