Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

require_movement in slider plugins don't allow for using only the keyboard #1783

Closed
gorkang opened this issue Apr 30, 2021 · 1 comment · Fixed by #2359
Closed

require_movement in slider plugins don't allow for using only the keyboard #1783

gorkang opened this issue Apr 30, 2021 · 1 comment · Fixed by #2359

Comments

@gorkang
Copy link

gorkang commented Apr 30, 2021

In #696 the require_movement conditional was changed from 'change' to 'click'. This solves an important issue, but creates a new one. Now, if someone is using the keyboard to answer the slider questions (TAB + arrows + TAB + space), the button won't activate. This is very common between computer savvy participants (e.g. Mechanical Turkers)

Not sure if there is an easier solution but adding a second conditional allows for both behaviours (only mouse or only keyboard).

So, changing:

    if(trial.require_movement){
      display_element.querySelector('#jspsych-html-slider-response-response').addEventListener('click', function(){
        display_element.querySelector('#jspsych-html-slider-response-next').disabled = false;
      });
    }

For this:

    if(trial.require_movement){
      display_element.querySelector('#jspsych-html-slider-response-response').addEventListener('click', function(){
        display_element.querySelector('#jspsych-html-slider-response-next').disabled = false;
      });
      display_element.querySelector('#jspsych-html-slider-response-response').addEventListener('change', function(){
        display_element.querySelector('#jspsych-html-slider-response-next').disabled = false;
      });
    }

Seems to solve the issue.

@becky-gilbert becky-gilbert added this to To do in MOSS milestone 3 via automation Apr 30, 2021
@becky-gilbert becky-gilbert added this to the 7.1 milestone Apr 30, 2021
@becky-gilbert
Copy link
Collaborator

Thanks for flagging this @gorkang! This solution seems very sensible to me.

@jodeleeuw jodeleeuw linked a pull request Nov 26, 2021 that will close this issue
@jodeleeuw jodeleeuw moved this from To do - would be nice to Done in MOSS milestone 3 Nov 27, 2021
This was referenced Nov 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants