Comments (10)
I can't replicate any problems using Chrome v33
Do you have the same problem on the demo page? http://danielcrisp.github.io/angular-rangeslider/demo/
from angular-rangeslider.
I see the same problem with the demo page. Namely, the thumbs don't respond to the mouse. I am using Chrome version 34.0.1847.11 beta-m on Windows 7 Prof (V6.1).
As a hack, one can tweak the onEvent, moveEvent, and offEvent assignments to replace the touch events with the corresponding mouse events. This hack will enable the thumbs to work with mouse input. But unfortunately it also prevents them from responding to touch.
//onEvent = (EVENT === 1 ? 'pointerdown' : (EVENT === 2 ? 'MSPointerDown' : (EVENT === 3 ? 'touchstart' : 'mousedown'))) + eventNamespace,
//moveEvent = (EVENT === 1 ? 'pointermove' : (EVENT === 2 ? 'MSPointerMove' : (EVENT === 3 ? 'touchmove' : 'mousemove'))) + eventNamespace,
//offEvent = (EVENT === 1 ? 'pointerup' : (EVENT === 2 ? 'MSPointerUp' : (EVENT === 3 ? 'touchend' : 'mouseup'))) + eventNamespace,
onEvent = (EVENT === 1 ? 'pointerdown' : (EVENT === 2 ? 'MSPointerDown' : (EVENT === 3 ? 'mousedown' : 'mousedown'))) + eventNamespace,
moveEvent = (EVENT === 1 ? 'pointermove' : (EVENT === 2 ? 'MSPointerMove' : (EVENT === 3 ? 'mousemove' : 'mousemove'))) + eventNamespace,
offEvent = (EVENT === 1 ? 'pointerup' : (EVENT === 2 ? 'MSPointerUp' : (EVENT === 3 ? 'mouseup' : 'mouseup'))) + eventNamespace,
from angular-rangeslider.
Ok I see - at the moment it only expects mouse OR touch support, not both.
var EVENT = window.PointerEvent ? 1 : (window.MSPointerEvent ? 2 : ('ontouchend' in document ? 3 : 4)), // 1 = IE11, 2 = IE10, 3 = touch, 4 = mouse
So probably we need to listen for mouse events even when touch support is detected and then cancel the mouse event when a touch event is triggered to prevent things happening twice.
Does this work?
onEvent = (EVENT === 1 ? 'pointerdown' + eventNamespace : (EVENT === 2 ? 'MSPointerDown' + eventNamespace : (EVENT === 3 ? 'touchstart' + eventNamespace + ' mousedown' + eventNamespace : 'mousedown' + eventNamespace))),
moveEvent = (EVENT === 1 ? 'pointermove' + eventNamespace : (EVENT === 2 ? 'MSPointerMove' + eventNamespace : (EVENT === 3 ? 'touchmove' + eventNamespace + ' mousemove' + eventNamespace : 'mousemove' + eventNamespace))),
offEvent = (EVENT === 1 ? 'pointerup' + eventNamespace : (EVENT === 2 ? 'MSPointerUp' + eventNamespace : (EVENT === 3 ? 'touchend' + eventNamespace + ' mouseup' + eventNamespace : 'mouseup' + eventNamespace))),
Untested, plus all the + eventNamespace
aren't very elegant
Also need to find a way to cancel the mouse events
from angular-rangeslider.
Unfortunately I'm still seeing the same behavior with these new assignments as with my previous hack. I.e., Chrome doesn't respond to touch but does respond to the mouse. But Firefox and IE respond to both.
from angular-rangeslider.
Hmm I don't have access to a touch screen computer so I'm not sure how I can debug this.
Is there a way I can emulate it?
Maybe the client
method needs updating based on this: http://stackoverflow.com/questions/18761078/detect-touch-events-in-chrome-on-windows-8-with-touchscreen
from angular-rangeslider.
Though I haven't found time to pursue it thoroughly yet, my attempts so far to use the approach outlined in the stackoverflow article that you mentioned have been fruitless. Specifically the event.touches property is undefined even though the event is labelled 'touchstart'. So that's suprising. As an alternative I briefly tried using the Polymer PointerEvents polyfill. But I didn't get it wired up properly with its dependencies. However, I subsequently observed that the widgets on the Polymer site aren't responding to touch on Win7|Win8 — Chrome|Canary either. Therefore I suspect that their polyfill won't work for this angular range-slider either.
from angular-rangeslider.
I fix this problem in EVENT == 3 ... insert 'X' before 'touchstart' ==>> 'touchstart' + eventNamespace + 'X' + ' mousedown' + eventNamespace
Replace this:
//onEvent = (EVENT === 1 ? 'pointerdown' : (EVENT === 2 ? 'MSPointerDown' : (EVENT === 3 ? 'touchstart' : 'mousedown'))) + eventNamespace,
for this:
onEvent = (EVENT === 1 ? 'pointerdown' + eventNamespace : (EVENT === 2 ? 'MSPointerDown' + eventNamespace : (EVENT === 3 ? 'touchstart' + eventNamespace + 'X' + ' mousedown' + eventNamespace : 'mousedown' + eventNamespace))),
work!
from angular-rangeslider.
danieljoppi's fix worked for me!
from angular-rangeslider.
Hm.... Can't get this working.
from angular-rangeslider.
The new dev tools on chrome allow you to emulate a touch screen device. I can replicate this issue in Chrome Version 37.0.2062.120 m
Open dev tools
Enable emulation
Enable 'Emulate touch screen'
Disable 'Emulate touch screen'
The sliders no longer respond to click.
https://developer.chrome.com/devtools/docs/device-mode
I have the same issue on a laptop which has a touch screen. The sliders do not respond to click events.
from angular-rangeslider.
Related Issues (20)
- [$injector:modulerr] Failed to instantiate module ui-rangeSlider due to: Error: [$injector:nomod] ...If registering a module ensure that you specify the dependencies as the second argument.
- Debounce/timeout before min/max model value changes
- How to show max value at the end slide and min value
- input value selection doesn't work when slider is moved (internet explorer)
- Scaling in multi rangeslider
- Anyway to get realtime slider value while sliding?
- How do you integrate it to an Angular 5 project?
- change the position of the slider by clicking
- direction: 'rtl' not supported HOT 1
- modelMin/modelMax must be a number HOT 1
- Changing orientation on the fly results into broken output HOT 3
- Single value slider HOT 2
- ui rangeslider conflict with ui-sortable HOT 1
- Text not selectable after drag HOT 1
- angular2 support HOT 2
- Step attribute not working as expected HOT 3
- range slider not working HOT 1
- show-values not working . HOT 7
- Not Working - Patch HOT 1
- under ng-if
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-rangeslider.