gjbarnard / moodle-format_topcoll

Collapsed Topics course format for Moodle.
http://docs.moodle.org/en/Collapsed_Topics_course_format
GNU General Public License v3.0
35 stars 60 forks source link

Clicking a section takes you to a neighbouring section in some circumstances #134

Closed cameron1729 closed 1 year ago

cameron1729 commented 1 year ago

Describe the bug Clicking a section takes you to a neighbouring section in some circumstances

To Reproduce On Moodle 4.1:

  1. Create a course with the Collapsed Columns format and the following settings:
    • Number of sections : 38
    • Elements: No additions
    • Column orientation: Horizontal
  2. press the "Save and display" button
  3. Click on "Section 2" in the left-hand drawer

Expected behaviour "Section 2" is at the top of the page and highlighted in the left hand navigation drawer.

Actual behaviour "Section 1" is at the top of the page and "Section 1" is highlighted in the left hand navigation drawer. Similar behaviour can be observed by clicking "Section 3" and "Section 4" etc.

Versions (please complete the following information):

gjb2048 commented 1 year ago
/*
ul.ctopics :target::before {
    height: auto;
    margin-top: 0;
    pointer-events: none;
    width: 0;
}
*/
/* Half the navbar height */
ul.ctopics :target {
  scroll-margin-top: 30px;
}