| Reference | Downloads | Github

Slider does not end routine

I set ‘Force end of Routine’ in the Slider Component but in the online Experiment after clicking on the scale the routine is not ended. in the standalone version on my mac it works. Any ideas? I am using v3.0.2


Hi Jakob,

I’ve experience this issue too. For now, if you want to end the routine when the user click on the slider, add a code component to your slider’s routine, and on the “Each Frame” tab, put this in the Javascript code:

if (slider.getRating() !== undefined) {
      continueRoutine = false
      slider.status = PsychoJS.Status.FINISHED

slider_example.psyexp (16.1 KB)

Check out the attached .psyexp. You can take a look at the result online at slider_example [PsychoPy]


Thank you! Works perfectly

Thanks Kevin, and we’ll make sure the code is correctly output (like that) from Builder in the next release

Another issue i found is that after calling slider.setReadOnly() the Slider is greyed out but it is still possible to set the value.

Yes, this was already in the JS code compiler for Slider, however was commented out as I was replicating the Slider demo code. See for pull req.