Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import Scrollbar from 'smooth-scrollbar'
export default class HorizontalScrollPlugin extends Scrollbar.ScrollbarPlugin {
transformDelta(delta, fromEvent) {
if (this.shouldInvertDelta(fromEvent)) {
return {
x: delta.y,
y: delta.y,
}
}
return delta
}
shouldInvertDelta(fromEvent) {
return this.options.events.some((rule) => fromEvent.type.match(rule))
}