Add 'back to top' of the page functionality

Created on 18 November 2021, almost 3 years ago
Updated 29 August 2024, 15 days ago

Problem/Motivation

Olivero is a theme created for accessibility, it would be great if the theme can integrate a button to go back to the top of the page. Websites often have long pages, this functionality becomes essential.

Steps to reproduce

Proposed resolution

Remaining tasks

See the tags

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

โœจ Feature request
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
Oliveroย  โ†’

Last updated less than a minute ago

Created by

๐Ÿ‡ซ๐Ÿ‡ทFrance zenimagine

Live updates comments and jobs are added and updated live.
  • Needs screenshots

    The change alters the user interface, so before and after screenshots should be added to document the UI change. Make sure to capture the relevant region only. Use a tool such as Aviary on Windows or Skitch on Mac OS X.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • last update over 1 year ago
    29,366 pass
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Gauravvv Delhi, India

    I have added back to top button. Please review

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Think we should have screenshots added to the issue summary.

    Also seems like a feature that should have some kind of test coverage.

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance zenimagine

    Hi, I just tested the patch, it works well, but needs some improvement.

    When the page is at the top, the back button should disappear and appear only when you start scrolling the page.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ehsann_95

    ahsannazir โ†’ made their first commit to this issueโ€™s fork.

  • Pipeline finished with Success
    about 2 months ago
    Total: 492s
    #230925
  • Pipeline finished with Success
    about 2 months ago
    Total: 748s
    #231738
  • Pipeline finished with Failed
    about 2 months ago
    Total: 167s
    #231848
  • Pipeline finished with Running
    about 2 months ago
    #231891
  • Status changed to Needs review about 2 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Kanchan Bhogade

    Hi
    I've tested MR 8872 on Drupal 11
    The MR is applied cleanly...

    For no page scroll, there is No back-to-top button as expected, and when the page scrolls, the back-to-top button appears.

    Attaching SS for reference
    RTBC+1

  • Status changed to Needs work about 2 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Seems all the tags are still needed. Also forgot issue summary update from before

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance zenimagine

    hi, I found the website below which has a button to go up to the top of the page. It's great because when you scroll the page, it displays around the arrow the length of the page. Can you add an animation for the length of the page (a circle like on the website below):

    https://planb.network/courses

  • Pipeline finished with Failed
    about 2 months ago
    Total: 165s
    #232760
  • Pipeline finished with Success
    about 2 months ago
    Total: 516s
    #232832
  • Pipeline finished with Success
    about 2 months ago
    Total: 519s
    #233569
  • Status changed to Needs review about 2 months ago
  • Status changed to RTBC about 2 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Chandansha

    I've tested MR 8872 with the help of View live preview link.
    i attached the video for refference.
    I move it to RTBC.
    THANKS!!

  • Status changed to Needs work about 2 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States mherchel Gainesville, FL, US

    Left some general comments. We should also move this to a single directory component. It's a perfect use case.

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance zenimagine

    Nice work. For the animation, how will you handle the infinite scrolling pages? Maybe by disabling the feature?

  • Merge request !8932SDC and CSS only version of back to top. โ†’ (Open) created by mherchel
  • Pipeline finished with Failed
    about 2 months ago
    Total: 161s
    #234341
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States mherchel Gainesville, FL, US

    I created a new branch using SDC and CSS only (using scroll animations).

    Right now the scroll stuff only works on Chromium. The main functionality works on all browsers.

    That being said, I think we might still want to use Intersection Observer so that the show/hide works also works on all browsers.

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone New Zealand

    Trying for a better title. On scanning I kept thinking this was a regression.

  • Pipeline finished with Success
    about 2 months ago
    Total: 513s
    #234485
  • Pipeline finished with Failed
    about 2 months ago
    Total: 160s
    #234993
  • Status changed to Needs review about 2 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States mherchel Gainesville, FL, US

    The 3250234-back-to-top-mikes-sdc-branch above is ready for review. I added a JS fallback for older browsers and fixed some linting.

    Note the scroll progress only works in Chromium as progressive enhancement. I don't want to add a scroll event, which has the potential to slow down the browser.

    @ehsann_95 I see you're still putting in a bit of effort on the other branch. You're welcome to continue to do so, but there's still quite of work to be done. You're welcome to review the new MR, which should be a bit closer to complete.

  • Pipeline finished with Canceled
    about 2 months ago
    Total: 747s
    #235001
  • Pipeline finished with Failed
    about 2 months ago
    #235009
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ehsann_95

    @mherchel . I will move my branch to hidden. I'll review the MR and see what can i do to move it furhter. Thanks!

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ehsann_95

    ahsannazir โ†’ changed the visibility of the branch 3250234-add-the-functionality to hidden.

  • Status changed to Needs work about 1 month ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Hritick

    I have tested the Merge Request !8932 and after testing following are my observations.

    • I have applied the MR as a patch and it applied with no errors and applied successfully.

    • After applying the patch, it adds the "back to top" button at the bottom right of the screen for both the browsers , firefox and chrome.

    • For chrome, while scrolling the screen around the button a progress bar was shown and it is also interactive while scrolling the page but this feature is not available for firefox.

    • One thing I would like to point out which is that, after clicking the button for scrolling back to top and when the page is at the top the button does not disappear at its own, we have to again click back on the screen and then it disappears.

    • Another thing, I am not sure whether to count it as an issue or an suggestion, the button is appearing after a certain amount of scrolling which is according to me could be reduced by a small margin.

    • Overall the button is working smoothly. Attaching some screen recordings for reference.

      Thanks and regards.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States mherchel Gainesville, FL, US

    Thanks for the review. We also have some failing tests for some reason.

    For chrome, while scrolling the screen around the button a progress bar was shown and it is also interactive while scrolling the page but this feature is not available for firefox.

    Yeah, the scroll indicator uses a browser feature that's not yet available to FF. My thought is that this is not necessary for the functionality, so I consider it progressive enhancement.

    One thing I would like to point out which is that, after clicking the button for scrolling back to top and when the page is at the top the button does not disappear at its own, we have to again click back on the screen and then it disappears.

    Yeah, this is an accessibility requirement (WCAG 2.4.7 Focus Visible), which states as long as a control as focus, it must remain visible. I wonder if we should shift focus to something else.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Hritick

    hey @mherchel,

    Yeah, this is an accessibility requirement (WCAG 2.4.7 Focus Visible), which states as long as a control as focus, it must remain visible. I wonder if we should shift focus to something else.

    If we ignore this as of now , rest is good and ready to move forward.
    RTBC+

    Thanks and regards.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States tpham1023

    tpham1023 โ†’ changed the visibility of the branch 3250234-back-to-top-mikes-sdc-branch to hidden.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States tpham1023

    tpham1023 โ†’ changed the visibility of the branch 3250234-back-to-top-mikes-sdc-branch to active.

Production build 0.71.5 2024