`update` event fires for all handles when one is changed with a key press
See original GitHub issueWith multiple handles, moving one of them using the keyboard causes an update
event to fire on all 3 handles.
noUiSlider.create(slider_el, {
start: [30, 60, 90],
behaviour: 'drag',
connect: true,
tooltips: [true, true, true],
range: {
'min': 0,
'max': 100
}
});
slider_el.noUiSlider.on('update',
function(v, h, u, t, p) { if (!t) { console.log('update:', h); }});
slider_el.noUiSlider.on('set',
function(v, h, u, t, p) { if (!t) { console.log('set:', h); }}
Expected output upon moving handle number 2 with keyboard:
update: 1
set: 1
Actual output:
update: 0
update: 1
set: 1
update: 2
This causes a bug with my solution in #957 when trying to move handle number 2 back past the margin of handle number 1; the event handler for handle number 1 gets executed first and modifies the position of handle number 2 such that when the update
event for handle number 2 subsequently fires, there’s nothing to do.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Angular 2 change event on every keypress - Stack Overflow
registers an event on every keystroke unlike (change) event; includes the keys that (keypress) ignores; has no lag unlike the (keydown) ...
Read more >Handling Events :: Eloquent JavaScript
Pressing a key fires "keydown" and "keyup" events. Pressing a mouse button fires "mousedown" , "mouseup" , and "click" events.
Read more >JavaScript Keyboard Events Explained
The keyboard events typically fire on the text box, though all elements ... Both keydown and keypress events are fired before any change...
Read more >Element: keydown event - Web APIs | MDN
The keydown event is fired when a key is pressed. Unlike the deprecated keypress event, the keydown event is fired for all keys, ......
Read more >Detect single and multiple keypress events: JavaScript
At the moment our 'do something' code will fire on every key press. More commonly it is likely that we want to tie...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is fixed in noUiSlider 13.1.3. Many thanks for contributing, @eoghanmurray! Much appreciated.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.