Skip to content

Commit

Permalink
Fix: Allow floats in slider position to item selection (fixes #193) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverfoster authored Sep 22, 2023
1 parent 873b93f commit a336e60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/SliderView.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class SliderView extends QuestionView {

// this shoud give the index of item using given slider value
getIndexFromValue(value) {
value = parseInt(value);
value = parseFloat(value);
const step = this.model.get('_scaleStep') ?? 1;
return this.model.get('_items').reduce((found, item) => {
if (found) return found;
Expand Down

0 comments on commit a336e60

Please sign in to comment.