Skip to content

Commit

Permalink
Following a Chrome/Firefox update, passive event listeners were added…
Browse files Browse the repository at this point in the history
… to addEventListener

provoking many issues on event handling (i.e., e.preventDefalt() stopped to work).

In this library, it resulted on weird scroll behavior on mobile, offcanvas appearing / disappearing, console warnings and wroing handling of offcanvas status (open/close).

See this comment for a good overview of the problem: https://stackoverflow.com/a/39187679

For the time being, jQuery hasn't shipped a solution yet, so .on() is still unable to pass the parameters to the native addEventListener. See this issue to track the status of jQuery:  jquery/jquery#2871

The only solution is to override touchmove event before loading jquery:
See https://stackoverflow.com/questions/39152877/consider-marking-event-handler-as-passive-to-make-the-page-more-responsive
and https://stackoverflow.com/questions/46094912/added-non-passive-event-listener-to-a-scroll-blocking-touchstart-event

The code has been inserted on bootstrap.offcanvas.coffee and needs to be loaded after jQuery and before the library.
  • Loading branch information
idiazroncero committed May 6, 2019
1 parent c1b90a0 commit 6ad110b
Show file tree
Hide file tree
Showing 5 changed files with 3,059 additions and 48 deletions.
48 changes: 21 additions & 27 deletions dist/js/bootstrap.offcanvas.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/js/bootstrap.offcanvas.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6ad110b

Please sign in to comment.