@@ -95,7 +95,12 @@ function keyboardInit() {
95
95
96
96
document . body . addEventListener ( 'orientationchange' , keyboardOrientationChange ) ;
97
97
98
- document . removeEventListener ( 'touchstart' , keyboardInit ) ;
98
+ if ( window . navigator . msPointerEnabled ) {
99
+ document . removeEventListener ( "MSPointerDown" , keyboardInit ) ;
100
+ }
101
+ else {
102
+ document . removeEventListener ( 'touchstart' , keyboardInit ) ;
103
+ }
99
104
}
100
105
101
106
function keyboardNativeShow ( e ) {
@@ -176,7 +181,12 @@ function keyboardShow(element, elementTop, elementBottom, viewportHeight, keyboa
176
181
// any showing part of the document that isn't within the scroll the user
177
182
// could touchmove and cause some ugly changes to the app, so disable
178
183
// any touchmove events while the keyboard is open using e.preventDefault()
179
- document . addEventListener ( 'touchmove' , keyboardPreventDefault , false ) ;
184
+ if ( window . navigator . msPointerEnabled ) {
185
+ document . addEventListener ( "MSPointerMove" , keyboardPreventDefault , false ) ;
186
+ }
187
+ else {
188
+ document . addEventListener ( 'touchmove' , keyboardPreventDefault , false ) ;
189
+ }
180
190
181
191
return details ;
182
192
}
@@ -200,7 +210,12 @@ function keyboardHide() {
200
210
} ) ;
201
211
202
212
// the keyboard is gone now, remove the touchmove that disables native scroll
203
- document . removeEventListener ( 'touchmove' , keyboardPreventDefault ) ;
213
+ if ( window . navigator . msPointerEnabled ) {
214
+ document . removeEventListener ( "MSPointerMove" , keyboardPreventDefault ) ;
215
+ }
216
+ else {
217
+ document . removeEventListener ( 'touchmove' , keyboardPreventDefault ) ;
218
+ }
204
219
document . removeEventListener ( 'keydown' , keyboardOnKeyDown ) ;
205
220
}
206
221
@@ -319,6 +334,11 @@ ionic.Platform.ready(function() {
319
334
320
335
// only initialize the adjustments for the virtual keyboard
321
336
// if a touchstart event happens
322
- document . addEventListener ( 'touchstart' , keyboardInit , false ) ;
337
+ if ( window . navigator . msPointerEnabled ) {
338
+ document . addEventListener ( "MSPointerDown" , keyboardInit , false ) ;
339
+ }
340
+ else {
341
+ document . addEventListener ( 'touchstart' , keyboardInit , false ) ;
342
+ }
323
343
} ) ;
324
344
0 commit comments