JSFiddle - React, Tailwind, and code Playground
JavaScript
document.addEventListener('wheel', function(e) {
deltaX = e.deltaX;
if (navigator.userAgent.match(/Edge\/\d+/)) {
deltaX = -deltaX;
}
if (deltaX > 0) {
// right horizontal scroll
alert ('right');
}
if (deltaX < 0) {
// left horizontal scroll
alert ('left');
}
})