Giter Club home page Giter Club logo

Comments (6)

ndkv avatar ndkv commented on July 16, 2024

This is still the case on Firefox 34. Reopen the issue?

I'm willing to work on a fix, any hints on where to start are welcome.

from dragend.

malthoff avatar malthoff commented on July 16, 2024

Not on a computer right now, so cannot really check the flag, but what I learnt is that when you emulate mobile devices in Firefox and close firefox entirely it sometimes does not reset a flag that enables/disabled drag functionality. So dragging works in Firefox for "normal" users that do not use the dev tools. Double check this please.

from dragend.

ndkv avatar ndkv commented on July 16, 2024

Thanks for your quick response on this special evening! 🎄

That's a tricky thing you've tracked there. I suspected something like that so I restarted my machine but the problem persists.

I noticed that

isTouch = 'ontouchstart' in win 

on line 100 of the source returns true in Firefox and false in Chrome. I don't know what this means but I feel that anything with touch should be false on my touchless laptop i.e. Chrome's answer is correct. I can imagine this may cause trouble somewhere down the line.

Update: setting isTouch = false manually fixes the issue! However, this doesn't turn off the selection of text. Any idea how to switch that off? It will improve the experience in IE as well as text is selected while dragging with the mouse as well.

FWIW The broken swipe in Firefox isn't a real issue as I'm going to add scroll buttons anyway. I'm not a fan of swiping with the mouse. 😄

from dragend.

malthoff avatar malthoff commented on July 16, 2024

Yes, but what I meant is that you can reset the flag in about:config. The dev tools change this flag and do not reset it when you close them. It won't change on reboot either.

from dragend.

malthoff avatar malthoff commented on July 16, 2024

Ultimately it's a bug a normal user will never see. But someone using the dev tools might run into this case. Reseting Firefox to its factory state should remove the wrong setting too

from dragend.

ndkv avatar ndkv commented on July 16, 2024

Right, got ya. Good to know that flags aren't reset after restart/reboot.

In the meantime I fixed the issue: replace isTouch = 'ontouchstart' in win

with something like

isTouch = (win.ontouchstart !== null && win.ontouchstart !== undefined) ? true : false;

It turns out that Firefox' window object does have an ontouchstart property. It's value is, however, equal to null. Chrome doesn't have one hence the !== undefined check.

Is this a sensible solution?

Text selection can be turned off with the CSS statment user-select: none;.

Update Of course this was too easy, this change brakes swiping on Chrome and Firefox on Android. Hello there touch detection hell! I'm reverting to original solution and adding buttons. Merry Christmas. 😄

Update 2 To whom it may concern: win.ontouchstart equals null on Firefox (desktop and Android) and on Chrome (Android). It is equal to undefined on Chrome (desktop). Go figure...

from dragend.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.