Comments (4)
This is expected behavior. When the knobs overlap, because the slider is unaware of the UI, it can only guess which knob the user intends to move (telekinesis is coming in a future update ;) ). The only reliable thing to do is move them both. It could be more granular about checking the exact pixel where the click starts but I feel that might lead to some bad UX.
In the case of your linked demo, the inactive image you're using for the knobs has a bunch of padding which causes it to not look overlapped to the user, but in the DOM they actually are. Using active and inactive images that are the same width should help with that. Another option would be to set a buffer so the knobs don't overlap.
I'll leave this open for more feedback but for now I'm leaving it as is.
from angular-slider.
@drgould That example works quite alright, but if I try to use the last version of angular-slider.js, there are some issues with the knobs. They don't move properly.
(ofc I changed ng-model-low to ng-model and ng-model-high to ng-model-range)
from angular-slider.
A little hack which can help here.
When both knobs are overlapped, if user is trying to select one knob the value of ref variable in onMove function is 'selectBar', So I added this piece of code (pseudocode):
onMove(){
......
if(isDualKnob) {
// dual knob slider
if (ref === 'selectBar' ){
ref = 'ngModelHigh';
}
......
}
}
So when selection is undefined right knob will be returned.
Quite primitive, but works.
P.S. I also used older version of angular-slider.js, due to its' better performance.
from angular-slider.
The problem with moving both sliders is that it makes it impossible to separate them, as far as I can see. So if you move them so they overlap, you are unable to move them where you want afterwards. How is a user supposed to solve this?
If you only move one of them, this is not a problem. Even if you move the one the user didn't intend to move, he will still be able to move them to the intended locations since they now are separated.
from angular-slider.
Related Issues (20)
- Different styles for the pointers
- Bump angular dep to ~1.3 HOT 4
- function stepBubbles() missing from code HOT 2
- Style selected area of a single know slider HOT 1
- Extra label functionality HOT 4
- bubble.ceiling will not position correctly if parent DOM element uses a CSS transition on width
- low and high knobs coincide
- No Working on mobile HOT 4
- Max difference attribute?
- bind to a input box, cannot change the value HOT 2
- IE11 memory leak HOT 1
- Avoid very slow performance?
- Is this still active?
- Assignable ceil and floor
- Slider knob not moving with keyboard controls
- Where is the demo? HOT 7
- no demo and no CSS files
- Can be used in the 1.4.7 version of the angular
- npm publish ? HOT 1
- slider failed at display elements
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-slider.