diff --git a/js/utils/tap.js b/js/utils/tap.js index d18e23c95d8..a22ec68a87b 100644 --- a/js/utils/tap.js +++ b/js/utils/tap.js @@ -170,6 +170,11 @@ ionic.tap = { (ele.tagName == 'INPUT' && (/^(date|time|datetime-local|month|week)$/i).test(ele.type)); }, + isVideo: function(ele) { + return !!ele && + (ele.tagName == 'VIDEO'); + }, + isKeyboardElement: function(ele) { if ( !ionic.Platform.isIOS() || ionic.Platform.isIPad() ) { return ionic.tap.isTextInput(ele) && !ionic.tap.isDateInput(ele); @@ -351,11 +356,13 @@ function tapMouseDown(e) { console.log('mousedown', 'stop event'); e.stopPropagation(); - if ((!ionic.tap.isTextInput(e.target) || tapLastTouchTarget !== e.target) && !(/^(select|option)$/i).test(e.target.tagName)) { + if ((!ionic.tap.isTextInput(e.target) || tapLastTouchTarget !== e.target) && !(/^(select|option)$/i).test(e.target.tagName) && !ionic.tap.isVideo(e.target)) { // If you preventDefault on a text input then you cannot move its text caret/cursor. // Allow through only the text input default. However, without preventDefault on an // input the 300ms delay can change focus on inputs after the keyboard shows up. // The focusin event handles the chance of focus changing after the keyboard shows. + // Windows Phone - if you preventDefault on a video element then you cannot operate + // its native controls. e.preventDefault(); }