Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Back to Top component to appear dynamically based on page height #2796

Closed
2 of 6 tasks
randimays opened this issue May 2, 2024 · 4 comments
Closed
2 of 6 tasks
Assignees
Labels
bug Something isn't working new-unplanned Unplanned work added to a sprint platform-design-system-team va-back-to-top DS Back to top component

Comments

@randimays
Copy link

Bug Report

  • I’ve searched for any related issues and avoided creating a duplicate issue.

What happened

The existing guidance for the Back to top (BTT) component says that it should not be used on pages with dynamic content. This excludes quite a few pages (all Drupal pages), even when a BTT component would be helpful on those pages.

We have some examples of BTT being used on pages that have dynamic content:

This code and guidance likely predates most of us. But it's worth noting that our usage of the component is inconsistent, and it doesn't make sense to leave the decision of whether to include BTT to the individual page or the teams. We propose:

The Back to top component should appear dynamically (based on the page height).

If the BTT component can calculate when it should appear based on page height, we can then add the component to basic page templates, and remove the decision-making on when to add it from the teams.

Slack thread for context: https://dsva.slack.com/archives/C01DBGX4P45/p1714680374615469

What I expected to happen

I expect the BTT component to appear on every page of VA.gov where scrolling is needed.

Urgency

How urgent is this request? Please select the appropriate option below and/or provide details

  • This bug is blocking work currently in progress
  • This bug is affecting work currently in progress but we have a workaround
  • This bug is blocking work planned within the next few sprints
  • This bug is not blocking any work
  • Other

Details

@caw310
Copy link
Contributor

caw310 commented May 16, 2024

@ataker
Copy link
Contributor

ataker commented May 22, 2024

We'll address the guidance in another ticket. Back to top can be used in dynamic pages. Closing this one.

@ataker ataker closed this as completed May 22, 2024
@randimays
Copy link
Author

@ataker Could you clarify the resolution here?

What we would like to be able to do is add va-back-to-top to every single page template on VA.gov, and have the component appear only if the page is long enough. Ideally, the web component would calculate this on its own and display when necessary.

We are already using va-back-to-top on pages with dynamic content, but we can't predict the length of every page that is using the template. So the va-back-to-top sometimes shows up on pages that are very short.

@randimays
Copy link
Author

CC @jilladams @FranECross @laflannery for awareness

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working new-unplanned Unplanned work added to a sprint platform-design-system-team va-back-to-top DS Back to top component
Projects
None yet
Development

No branches or pull requests

3 participants