seiyria / bootstrap-slider

A slider control for Bootstrap 3 & 4.
http://seiyria.github.io/bootstrap-slider/
Other
3k stars 1.14k forks source link

Hovering over ticks overwrites slider state #882

Closed jespirit closed 5 years ago

jespirit commented 5 years ago

The _state is overridden because the statement below does not actually create a temporary copy of the state.

https://github.com/seiyria/bootstrap-slider/blob/59745c648eb9a4e937783c7177521219212112ab/src/js/bootstrap-slider.js#L1174

https://github.com/seiyria/bootstrap-slider/blob/59745c648eb9a4e937783c7177521219212112ab/src/js/bootstrap-slider.js#L1172-L1184

  1. Open a console
  2. Move the handle to the middle (value of 5).
  3. Hover over the rightmost tick once. Should display hover: 5
  4. Repeat step 3 multiple times. Should display hover: 2

Note: Also try hovering over the leftmost tick.

console.log('hover:', mySlider.getValue());

https://jsfiddle.net/xq0cgoa5/

Issues

NOTE: Before filing a new issue, please search through the open issues list and check to see if an existing issue already exists that describes your problem. If so, leave a comment within that issue with the checklist items described below.

Please make sure you include the following in your issue report where appropriate: