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

[Bug report] RouteLink in VPNavbarItems not wide enough - Navbar Dropdown has unclickable areas #336

Open
stfsy opened this issue Jan 11, 2025 · 1 comment

Comments

@stfsy
Copy link

stfsy commented Jan 11, 2025

Description

With the current version of the default theme (@2.0.0-rc.68), RouteLinks inside VPNavbarItems dropdown do not have the same width as the dropdown menu. This causes areas inside the dropdown to look clickable (because the background gets changed when hover was fired), but the click event never reaches the link.

image

Older versions of VuePress set display of a inside .navbar-dropdown-item to display: block. It's deployed here. I cannot track down the version easily. In this case the a is as wide as the dropdown menu. Thus, the whole area is clickable in contrast to the current scenario.

image

I am confident this behaviour was introduced with 7080aa3.

With 7080aa3 see a lot of refactoring took place. However, we can see that,

this CSS that got deleted: 7080aa3#diff-7a9faadb210a337915e80c598f748b4821534eab25ca10f296a423a33fcc0ed3L68-L76

image

this CSS that got added: 7080aa3#diff-910b8cff4306fa71ea33bdee3090877c0d92c38bd46cc5103ab3ec6ab84d3a21R64-R66

image

Here's the code for my navbar:

import fs from 'node:fs'

const { version } = JSON.parse(fs.readFileSync('package.json'))

export default [{
    text: 'Getting Started',
    link: '/getting-started/',
},
{
    text: 'API',
    children: [
        {
            text: 'Overview',
            link: '/api-overview/',
        },
        {
            text: 'API Best Practices',
            link: '/api-best-practices/',
        },
    ]
},
{
    text: `Community`,
    children: [
        {
            text: 'Code of Conduct',
            link: 'https://github.com/discue/.github/blob/main/CODE_OF_CONDUCT.md',
        },
        {
            text: 'Security Policy',
            link: `https://github.com/discue/.github/blob/main/SECURITY.md`,
        },
    ],
},
{
    text: `v${version}`,
    children: [
        {
            text: 'Changelog',
            link: 'https://github.com/discue/api-docs/blob/main/CHANGELOG.md',
        },
    ],
}]

Reproduction

https://github.com/discue/api-docs/tree/vuepress-dropdown-unlickable-areas

Used Package Manager

npm

System Info

info
  System:
    OS: Windows 11 10.0.26100
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-11370H @ 3.30GHz
    Memory: 3.07 GB / 15.79 GB
  Binaries:
    Node: 22.11.0 - C:\tools\node-v22.11.0-win-x64\node.EXE
    Yarn: Not Found
    npm: 10.9.2 - C:\tools\node-v22.11.0-win-x64\npm.CMD
    pnpm: Not Found
    bun: Not Found
  Utilities:
    Git: 2.46.1. - /mingw64/bin/git
  Browsers:
    Chrome: Not Found
    Edge: Chromium (131.0.2903.99)
  npmPackages:
    @vuepress/bundler-vite: ^2.0.0-rc.19 => 2.0.0-rc.19
    @vuepress/bundler-webpack: Not Found
    @vuepress/cli:  2.0.0-rc.19
    @vuepress/client:  2.0.0-rc.19
    @vuepress/core:  2.0.0-rc.19
    @vuepress/markdown: 2.0.0-rc.19 => 2.0.0-rc.19
    @vuepress/shared:  2.0.0-rc.19
    @vuepress/utils:  2.0.0-rc.19
    vue:  3.5.13
    vue-router:  4.5.0
    vuepress:  2.0.0-rc.19
@stfsy
Copy link
Author

stfsy commented Jan 11, 2025

This is a screenrecording that shows that areas outside of the a tag are not clickable:
https://github.com/user-attachments/assets/e0568133-4e05-4dee-a455-2703243ed558

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant