Closed pbuzdin closed 4 years ago
Hello! Right now click event is not prevented by default. Maybe its a good idea to prevent any clicks by default, I'll think about it, thanks Right now you can do this:
new ScrollBooster({
...
onClick: (state, event) => {
// prevent default link event
const isLink = event.target.nodeName.toLowerCase() === 'link';
if (isLink) {
event.preventDefault();
}
}
});
It would be better to still allow normal clicks. See https://github.com/donmbelembe/vue-dragscroll/issues/61#issuecomment-583951401 for a possible solution.
Good workaround, thank you! For now I implemented drag offset based solution instead of timer based, because I have access to those metrics
So preventDefault
is called only when scrolled more than 5 pixels
https://github.com/ilyashubin/scrollbooster/commit/15f826449875f8fcfdcc558882a661971f68e96d
Nice, thanks for the fix.
This fix is in v2.2.2, closing
Hi, Ilya!
If there are links in draggable container, they will be fire click event while dragging.