-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
3.7.3, 3.8.1, 3.11.10
-
MOODLE_311_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
-
MDL-67235-master
Typically speaking you do not expect something to activate until the keyup event. This can cause issues where a button has focus as a result of something else being closed.
For example, a modal launched from within another modal.
If you close the inner modal by pressing the [X] using the space bar, then the focus should be returned to the item that caused it to be opened... at which point you are still holding down the space bar, and when you lift the key, the keyUp event causes the inner modal to be re-opened.
This can be seen in action:
- Log in as student
- View a forum which has grading enabled
- Click on the "View grade" button
- Tab to the [X] or [Cancel] button
- Press and hold space
- [The modal closes]
- Release the space bar
- [The modal reopens]
The [X] key and [Cancel] buttons make use of the Custom interaction events's "Activate" event, whose 'real' event is currently set to:
element.off('keydown.cie.activate').on('keydown.cie.activate', function(e) {
|
i.e. It is listening for the 'keydown' event to 'activate' the close/cancel button.
Changing this to a keyUp event means that the button is only activated when the key is released, and therefore does not trigger the button which opens the modal again.
- Discovered while testing
-
MDL-67207 Capture focus in Grader
-
- Closed
-