I have a slider element in my data viz app that I want to fire an event with slider drag completes. This solution uses the change event and works fine in Chrome.
this.slider.addEventListener('change', e => {
// do something when slider changes
})
However, FireFox and Safari only support the input event so the above approach will not work. What is the best work around to simulate change event in FireFox and Safari.
Here is all the relevant JS code
const slider = document.createElement('input')
slider.type = 'range'
slider.min = 10
slider.max = 20
document.body.appendChild(slider)
slider.addEventListener('change', e => {
// do something when slider changes
console.log("change");
})
False alarm. Solved. This is has nothing to do with the input/range element. I have one or more event handlers attached to the document that are consuming mouse events intended for the input/range element.