1

I'm using Swipebox : http://brutaldesign.github.io/swipebox/ I know that I can open a content with swipebox slide like that

// Link to click
<a href="#mydiv" class="my-swipebox">Click to show</a>

// And the div in html
<div id="#mydiv">Click <a href="http://example.com">Here</div>

The problem is I can't click the link inside this div when it opened by swipebox on mobie (on desktop it working very fine)

The chrome browser show this log :

[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080
preventDefault @ js_3q9o_g1v9VMwOb38KwiIL35eXGTsWaJ31hpdemJVNbY.js:5
dispatch @ js_3q9o_g1v9VMwOb38KwiIL35eXGTsWaJ31hpdemJVNbY.js:5
v.handle @ js_3q9o_g1v9VMwOb38KwiIL35eXGTsWaJ31hpdemJVNbY.js:5

How can I fix this problem, thank you so much

tungcan
  • 119
  • 4
  • 12
  • Can you post your JavaScript along with your question please. – Kristian Roebuck Jul 15 '17 at 16:56
  • Hello @KristianRoebuck, you can download code at the bottom of this page, http://brutaldesign.github.io/swipebox/, and you can put my code inside index.html, make swipe call (javascript) by $(".my-swipebox").swipebox(). THanks – tungcan Jul 15 '17 at 17:04

2 Answers2

1

A passive event listener is an event where you promise the browser that you will never invoke event.preventDefault(). That way the browser can optimize actions like scrolling/touches because the browser can assume the developer will not be cancelled out (e.g. disabling scrolling).

Chrome enables this by default as per version 56: https://www.chromestatus.com/features/5093566007214080. They made this change as a way to optimize scrolling.

If you do not want to this to happen, you can add { passive: false } as the third argument to .addEventListener.

Read more about passive events at: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md

Zomry
  • 1,141
  • 12
  • 14
0

I added loop: true in .js for this : $('.owl-carousel').owlCarousel({ and it's work

arimas
  • 21
  • 1
  • Welcome to SO! Try to explain a little bit your answer. Even if it is working, it is not clear what should be done. – David García Bodego Dec 28 '19 at 09:20
  • in my case , my js is here: $('.owl-carousel').owlCarousel({ rtl: true, // loop: true, // dots: true, autoWidth: true, margin: 13, responsive: {//for count of item for show 0: { items: 1 }, 480: { items: 2 }, 768: { items: 5 }, 100: { items: 10 } } }); i uncommented loop:true , and this error be ok – arimas Dec 29 '19 at 05:47
  • 1
    So, please, add this information to your answer and you will be upvoted. Great! – David García Bodego Dec 30 '19 at 12:13