-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
4.1.10, 4.3.5, 4.5
-
MOODLE_401_STABLE, MOODLE_403_STABLE, MOODLE_405_STABLE
-
MDL-82625-main
-
-
-
Bug Description
There is an observed bug in the tertiary menu navigation functionality of Moodle where checkmarks indicating the current menu item active does not correspond with the current page after bfcache.
This issue arises specifically when using the back and forward buttons in the browser. As a result, the previous menu item stays active (with checkmarks) when the current page is actually different which represents a significant accessibility issue.
Steps to Reproduce
- Navigate to a course in Moodle (single activity format / multitopic).
- Click on a menu with tertiary menu navigation item (e.g., "Grades", "Results", "Question Bank", "Course reuse").
- Click now on one of the options in the dropdown menu.
- Use the browser's back button to return to the previous page.
- Observe the checkmarks remains on the previous menu item selected.
- Observe the top menu item remains unchanged.
Following pictures showing an example with the Grades menu item:
- Single view report is selected on this scree.
- Then, 'Grade summary' is selected from the tertiary menu navigation and page changes as expected.
- User navigates by clicking on the browser's back button. Page changes as expected to the single view report. However, the top menu displayed belongs to the previous page 'Grade summary'
- Expanding the dropdown, it can be seen that 'Grade summary' is shown as active.
Analysis
The root cause of the issue here is similar but distinct to that reported in MDL-82298. In this instance the checkmarks are controlled by aria.js in theme_boost. The dropdown itself is a "combobox", which in of itself does not redirect to another page. So adding the checkmarks is totally valid, and it's done here: https://github.com/moodle/moodle/blob/a320dff7362544349f884a423319148a259cdad3/theme/boost/amd/src/aria.js#L373-L377
However, in this instance (and probably others in core) there is additional JavaScript which redirects the user when the item is selected.
This results in exactly the same situation as MDL-82298. i.e., the checkmark is added and then the user is immediately navigated away from the page. If they press the back button and the previous page is served from the browser's cache, then the erroneously added checkmark is still present.
Solution
Unfortunately theme_boost's aria.js does not have a mechanism to disable the adding of checkmarks. So probably we'd have to implement something similar to the disableactive thing which was used in MDL-82298.
- blocks
-
MDL-83523 Combobox prevents re-selection of the page after pressing the back button
-
- Reopened
-