Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions js/utils/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,12 @@ function keyboardInit() {

document.body.addEventListener('orientationchange', keyboardOrientationChange);

document.removeEventListener('touchstart', keyboardInit);
if (window.navigator.msPointerEnabled) {
document.removeEventListener("MSPointerDown", keyboardInit);
}
else {
document.removeEventListener('touchstart', keyboardInit);
}
}

function keyboardNativeShow(e) {
Expand Down Expand Up @@ -176,7 +181,12 @@ function keyboardShow(element, elementTop, elementBottom, viewportHeight, keyboa
// any showing part of the document that isn't within the scroll the user
// could touchmove and cause some ugly changes to the app, so disable
// any touchmove events while the keyboard is open using e.preventDefault()
document.addEventListener('touchmove', keyboardPreventDefault, false);
if (window.navigator.msPointerEnabled) {
document.addEventListener("MSPointerMove", keyboardPreventDefault, false);
}
else {
document.addEventListener('touchmove', keyboardPreventDefault, false);
}

return details;
}
Expand All @@ -200,7 +210,12 @@ function keyboardHide() {
});

// the keyboard is gone now, remove the touchmove that disables native scroll
document.removeEventListener('touchmove', keyboardPreventDefault);
if (window.navigator.msPointerEnabled) {
document.removeEventListener("MSPointerMove", keyboardPreventDefault);
}
else {
document.removeEventListener('touchmove', keyboardPreventDefault);
}
document.removeEventListener('keydown', keyboardOnKeyDown);
}

Expand Down Expand Up @@ -316,6 +331,11 @@ ionic.Platform.ready(function() {

// only initialize the adjustments for the virtual keyboard
// if a touchstart event happens
document.addEventListener('touchstart', keyboardInit, false);
if (window.navigator.msPointerEnabled) {
document.addEventListener("MSPointerDown", keyboardInit, false);
}
else {
document.addEventListener('touchstart', keyboardInit, false);
}
});