Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-71152

Anchor link offset fix is not working with "display:flex" elements

    XMLWordPrintable

Details

    • MOODLE_310_STABLE, MOODLE_311_STABLE
    • MOODLE_310_STABLE, MOODLE_311_STABLE
    • MDL-71152-311
    • MDL-71152-master
    • Hide

      Please, test in Firefox, Chrome, Safari and Edge, using Boost and Classic.

      1. Login as admin
      2. Create a new course with topics format and 20 sections
      3. Click on the "Topic 15" heading text
      4. Check that page scroll to the start of the section correctly
      5. Go to the dashboard
      6. WIth the inspector look for some id of the righ side blocks (Should be something like "inst18")
      7. Add "#inst18" to the browser URL and press enter
      8. Check that page scroll to the start of the block
      Show
      Please, test in Firefox, Chrome, Safari and Edge, using Boost and Classic. Login as admin Create a new course with topics format and 20 sections Click on the "Topic 15" heading text Check that page scroll to the start of the section correctly Go to the dashboard WIth the inspector look for some id of the righ side blocks (Should be something like "inst18") Add "#inst18" to the browser URL and press enter Check that page scroll to the start of the block

    Description

      When using anchor in URLs, page should scroll to the element with the same  id as the anchor. But adding the fixed header height is needed so elements don't hide underneath the header.

      There is a fix for that: https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/drawer.scss#L9-L16

      But this fix does not work propperly with elements having"display:flex".

      Test:

      1. Login and access the dashboard
      2. WIth the inspector look for some id of the righ side blocks (Should be something like "inst18")
      3. Add "#inst18" to the browser URL and press enter
      4. Check that page scroll to the block but it is partially hidden by the fixed header.
      5.  

       

      Attachments

        1. image-2021-03-19-14-10-23-265.png
          138 kB
          Mikel Martín Corrales
        2. MDL-71152_Chrome.png
          202 kB
          Angelia Dela Cruz

        Issue Links

          Activity

            People

              mikelmartíncorrales Mikel Martín Corrales
              mikelmartíncorrales Mikel Martín Corrales
              Bas Brands Bas Brands
              Víctor Déniz Falcón Víctor Déniz Falcón
              Angelia Dela Cruz Angelia Dela Cruz
              Huong Nguyen, Bas Brands, Mathew May
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                13/Sep/21

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 35 minutes
                  1d 35m