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

'Return to top' button is always visible in custom layout page #3811

Open
4 tasks done
2BAB opened this issue Apr 19, 2024 · 0 comments
Open
4 tasks done

'Return to top' button is always visible in custom layout page #3811

2BAB opened this issue Apr 19, 2024 · 0 comments
Labels
bug Something isn't working theme Related to the theme

Comments

@2BAB
Copy link

2BAB commented Apr 19, 2024

Describe the bug

It's always visible even you're already at the top, similar to this one #2312, however, it happened to custom layout on mobile devices (with narrow viewport width) this time.

image

Reproduction

  1. Add below to index.md:
---
layout: foo
navbar: false
sidebar: false
---
  1. Create the Foo.vue:
<template>
    <div style="width: 100%; 
        height: 2000px; 
        background-color: gray; 
        overflow: scroll;">
        ajidsjaisdjiajsiiajsdijasid
    </div>
</template>
  1. register it in the index.ts:
app.component('foo', Foo)

Then we will observe the bug like the above screenshot.

Expected behavior

  1. It can be automatically hide or show depend on the page location.
  2. It can be explicitly disable in configurations, like themeConfig: { ... returnToTop: false, ...}.

System Info

System:
    OS: macOS 14.4.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 11.13 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 16.13.1 - ~/.nvm/versions/node/v16.13.1/bin/node
    npm: 8.1.2 - ~/.nvm/versions/node/v16.13.1/bin/npm
  Browsers:
    Chrome: 124.0.6367.60
    Chrome Canary: 126.0.6425.0
    Safari: 17.4.1
  npmPackages:
    vitepress: ^1.1.0 => 1.1.0

Additional context

No response

Validations

@2BAB 2BAB added the bug: pending triage Maybe a bug, waiting for confirmation label Apr 19, 2024
@brc-dd brc-dd added bug Something isn't working theme Related to the theme and removed bug: pending triage Maybe a bug, waiting for confirmation labels Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working theme Related to the theme
Projects
None yet
Development

No branches or pull requests

2 participants