ArthurClemens / polythene

Material Design component library for Mithril and React
590 stars 43 forks source link

Sliders do not work in Firefox #68

Closed andershol closed 6 years ago

andershol commented 6 years ago

It seems that the sliders examples for both React and Mithril do not work in Firefox (verison 60) while it works in Chrome. The sliders are drawn correctly and the thumb changes to an active state when clicked, but it can not be dragged to a new value. No error is shown in the console. https://jsfiddle.net/ArthurClemens/ekht8sef/ https://jsfiddle.net/ArthurClemens/nL12sq4x/

ArthurClemens commented 6 years ago

I've downloaded the Firefox 60 beta for Mac. I can't reproduce the issue, sliders are working in this browser. Which platform are you on?

andershol commented 6 years ago

I'm on windows. I tested with addons disabled and that do not work either. But I also tested on a clean profile and that works. I can't see what is special in my profile, apart from addons, though.

andershol commented 6 years ago

Okay, I think I found the cause of the issue. In my config "dom.w3c_touch_events.enabled" was set to "1" and "dom.w3c_touch_events.expose" was "false". Setting these in a clean profile reproduces the problem. I am pretty sure I didn't set these manually, but (according to the first note in the browser compatibility section of the touch events documentation it seems that the settings was set to work-around some bug. So I might not be the only one with these set, so it should probably be worked around.

ArthurClemens commented 6 years ago

What course of action do you propose?

andershol commented 6 years ago

When you want to listen to e.g. "touchstart" (which I believe to be the problem in this case), you instead/also set up a listener for click or mousedown (depending on what you are trying to do). It is kind of a touch polyfill but much less general as you only need to handle the features and behavior of the event that you actually use. This issue also seems to affect the Menu examples, where it is not possible to close the open menu.

ArthurClemens commented 6 years ago

Fixed in release 1.2.0.