HFP-3658 Improve a11y focus on "Check" and "Show Solutions" #135
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When merged in, will introduce the same focus behavior that was introduced for Multiple Choice in HFP-3554: For both "Check" and "Show Solution" move the focus to the first answer. When calling showSolutions programatically, e.g. by a parent content type, the focus is not set.
note
If you encounter that: There's a bug when navigating that is not caused by the pull request, see HFP-3657.
background
Currently, the behavior of Drag the Words is inconsistent (similar to Multiple Choice, HFP-3554).
When clicking on "Check", the focus will be given to a non-tabbable element above the exercise (the instructions) in order to allow tabbing forward through the given answers.
When clicking on "Show solution", the focus will be set to the retry button (by H5P.Question). The dropzone fields are disabled and non-tabbable, so here the user would need to navigate backwards (not tabbing) in order to learn about the correct solutions. On top, the correct answers are in separate elements.