Touchmove pointer-events: none CSS doesn't work on Chrome for Android 4.4 / ChromeView

后端 未结 2 1221
抹茶落季
抹茶落季 2021-01-01 20:31

I\'m using CSS pointer-events to pass touchmove events through a transparent div. This works everywhere apart from Chrome on Android. I\'m wondering if this is a known iss

相关标签:
2条回答
  • 2021-01-01 20:42

    I solved this using the solution here: https://stackoverflow.com/a/20387287/1876899

    Thank you very much user wulftone! Somehow preventing the default touchStart event on my overlay allowed the interaction to pass through and trigger the events below.

    overlay.addEventListener('touchstart', function(e){
      e.preventDefault();
    });
    

    or in my case, with jQuery:

    $('.frame-overlay').on('touchstart', function(e){
      e.preventDefault();
    });
    
    0 讨论(0)
  • 2021-01-01 20:58

    Apparently there is a separate CSS property called touch-action:

    https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action

    Add touch-action: none; and it should work.

    0 讨论(0)
提交回复
热议问题