Skip to content

Commit be1d468

Browse files
fixed #102
1 parent de23c63 commit be1d468

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/nouislider.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,9 @@ function init(Survey) {
4242
]);
4343
},
4444
afterRender: function(question, el) {
45-
if (question.isEmpty()) {
46-
question.value = (question.rangeMin + question.rangeMax) / 2;
47-
}
48-
4945
el.style.marginBottom = "60px";
5046
var slider = noUiSlider.create(el, {
51-
start: question.value,
47+
start: question.value || (question.rangeMin + question.rangeMax) / 2,
5248
connect: [true, false],
5349
step: question.step,
5450
tooltips: true,
@@ -64,7 +60,7 @@ function init(Survey) {
6460
max: question.rangeMax
6561
}
6662
});
67-
slider.on("set", function() {
63+
slider.on("change", function() {
6864
question.value = slider.get();
6965
});
7066
var updateValueHandler = function() {

0 commit comments

Comments
 (0)