QuizandSurveyMaster / quiz_master_next

Quiz And Survey Master - A WordPress Plugin For Creating Quizzes, tests, exams and surveys
https://quizandsurveymaster.com
GNU General Public License v2.0
93 stars 86 forks source link

Keyboard navigation is broken #2540

Open NicktheGeek opened 4 months ago

NicktheGeek commented 4 months ago

IF YOU DO NOT FOLLOW THIS TEMPLATE, YOUR ISSUE MAY BE CLOSED!!

Please provide the following information when creating your issues:

Site Info

WordPress Version: 6.5.2 QSM Version: 9.0.1 Browser: Chrome, Firefox, and Safari but certainly all browsers.

General description

There has been a recent change that breaks keyboard navigation completely https://github.com/QuizandSurveyMaster/quiz_master_next/blob/master/js/qsm-quiz.js#L1963-L1965

That code prevents default when the tabkey is pressed. I don't understand exactly why this is happening. It looks like this is an attempt to have some custom navigation? In any case this has rendered the plugin fully inaccessible. Please do not prevent default navigation.

It is also generally scoped so it breaks keyboard navigation on the entire site, not just in the quiz which is even worse.

Link to quiz or screenshot (if relevant):

Expected behavior

Keyboard navigation will work normally.

Actual behavior

I can use tab to navigate but once I interact with something in Chrome it breaks the entire site and in Safari it breaks after interacting with a quiz element.

Steps to reproduce the behavior

  1. Add a form to a page/post
  2. Ensure there is at least one multiple choice option
  3. Use keyboard to navigate to the radio group
  4. Select an option
  5. The keyboard focus is completely trapped. It is possible to navigate the radio group with arrow keys but impossible to navigate away from the group

Please note: this is a massive issue completely breaking keyboard navigation. This needs to be addressed urgently.