Selectable icon indicating copy to clipboard operation
Selectable copied to clipboard

Better Support for Hybrid Devices

Open ollex opened this issue 6 years ago • 8 comments
trafficstars

Hi, when I simply try the demo link https://codepen.io/Mobius1/pen/OOXPwo in Chrome it's working great, in Firefox I can't select via the drag & drop (rectangle) option. It does not seem to work in FF at the moment? I have both the latest versions of these browsers installed. Edge for example works, too without any problems.

ollex avatar Dec 11 '18 09:12 ollex

It's working for me in FF 52.0, 62.0.3 and 63.0.3, but the unpkg MDN has been timing-out for the past day or so. It may be that. Any errors in the console?

Mobius1 avatar Dec 11 '18 10:12 Mobius1

ah that'd be great, I noticed slow loading times on a site I'm using it via the unpgk cdn so maybe it's just that but I didn't get any error messages in the console which is weird. I'll try to find out what it could be seems related to my FF installation then!

ollex avatar Dec 11 '18 14:12 ollex

Hm it is very weird. On 63.03 I was just until a few secs ago, selectablejs doesn't work with it nor do I see any errors. I updated to 64.0 and the same. The script is defo loaded I can even throw it into the same page above any js and the rectangular selection is not working, only in my FF (it remains not working on your demo with 64.0 in FF). It works in any other browser I throw at it (don't have IE installed though so Chrome and Edge are working just fine and I love your lib).

ollex avatar Dec 11 '18 15:12 ollex

ah .. I just figured something out: It has got to do with touch settings: I can select rectangular on FF with "touch" gestures, but I can't using the mouse. So it seems related to how the browsers are interpreting something in this respect. Chrome let's me do it with the mouse only when I navigate to your codepen, FF doesn't let me do it with the mouse. It right away only gives me the touch option. Do you have any idea what the cause of this different behaviour would be and is there a way touch can be disabled?

ollex avatar Dec 11 '18 15:12 ollex

OK - that's it: dom.w3c_touch_events.enabled in about:config set to 0 and I can select with the mouse in FF as in the other browsers. Good to know ... !

ollex avatar Dec 11 '18 15:12 ollex

Just out of curiosity, are you using a hybrid laptop that allows both mouse and touch controls? I coded selectablejs to remove the mousedown event listener on these type of devices to prevent conflicts with the touch controls. I may need to add an option to force enable / disable mouse and touch controls to get around these problems.

Mobius1 avatar Dec 11 '18 16:12 Mobius1

Yes, that's the case - I am on a hybrid, that probably makes it complicated! I personally am happy for my use cases if it's mouse only no touch. So if there is an easy way to enable/disable mouse or touch that is probably a great addition to make it work anywhere anyhow people might want it

ollex avatar Dec 11 '18 18:12 ollex

I'm gonna reopen this issue just in case anyone else comes here with the same problem. I'll modify the code to include better support for hybrid devices.

Mobius1 avatar Dec 11 '18 18:12 Mobius1