EragonJ / Trip.js

🚀 Trip.js is a plugin that can help you customize a tutorial trip easily with more flexibilities.
https://eragonj.github.io/Trip.js/
MIT License
793 stars 111 forks source link

optionally prevent click propagation out of the trip block #174

Closed 71FIL closed 8 years ago

71FIL commented 8 years ago

Some plugins react to clicks outside their boundaries by closing themselves. If that plugin is the object of a sequence of trips, a click in the first trip next button can close it and the following trip has lost the element it wants to show.

I suggest adding an option, stopClickPropagation, both local and global, that would allow to stop click propagation when needed.

EragonJ commented 8 years ago

yes you are right, there might have this scenario. Because there is no overhead to have this enabled, I think this option can be used by default and only for some special cases to disable that.

EragonJ commented 8 years ago

@71FIL if you click anywhere inside the trip in the first step (not action buttons), your plugin will still be closed, right ? I think this should be handled in trip-block (the container itself) for any click inside that block.

71FIL commented 8 years ago

@EragonJ Absolutely right. This is what I actually implemented: a click handler is added on the trip-block which calls stopPropagation if the option is set (locally or globally).

EragonJ commented 8 years ago

ok let's do that way ! @71FIL since you already had the fix already, can you send me a PR for this ? thanks !

EragonJ commented 8 years ago

fixed by https://github.com/EragonJ/Trip.js/commit/ecd5e835ffeaa1078e0114d23f65473d98c69b7f