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

'#nav-screen-content-after' does not work when screen width between [768,1280) #3773

Closed
4 tasks done
fiwalld opened this issue Apr 10, 2024 · 8 comments
Closed
4 tasks done
Labels
has-workaround Has workaround, low priority need more info Further information is requested

Comments

@fiwalld
Copy link

fiwalld commented Apr 10, 2024

Describe the bug

Hi there,

I want to extend the default theme layout by using '#nav-screen-content-after' slot, but if the screen size is between [768,1280) px, '#nav-screen-content-after' slot does not work.
I suppose all nav slots don't work when the window resize to [768,1280) px.
Please help fix the issue.

Thanks

Reproduction

1.Add '#nav-screen-content-after' layout slot according to https://vitepress.dev/guide/extending-default-theme#layout-slots.
2.Resize screen to [768,1280) px.
3.Nav layout slot component will disappear.

Expected behavior

Resize screen to [768,1280) px and the added layout slot component should be still exist.

System Info

System:
    OS: macOS 14.3.1
  Binaries:
    Node: 21.7.1 - ~/.nvm/versions/node/v21.7.1/bin/node
    npm: 10.5.0 - ~/.nvm/versions/node/v21.7.1/bin/npm
    pnpm: 8.15.5 - ~/.nvm/versions/node/v21.7.1/bin/pnpm
  Browsers:
    Chrome: 123.0.6312.107
    Safari: 17.3.1
  npmPackages:
    vitepress: ^1.1.0 => 1.1.0

Additional context

No response

Validations

@fiwalld fiwalld added the bug: pending triage Maybe a bug, waiting for confirmation label Apr 10, 2024
@brc-dd
Copy link
Member

brc-dd commented Apr 10, 2024

nav screen is this area (the mobile nav menu):

image

why would that slot be shown on larger viewports? (and it's not shown on 1280+ width too) Can you explain what are you trying to do?

@brc-dd brc-dd added need more info Further information is requested and removed bug: pending triage Maybe a bug, waiting for confirmation labels Apr 10, 2024
@fiwalld
Copy link
Author

fiwalld commented Apr 11, 2024

Add 'test' to '#nav-screen-content-after' slot, it shows under web and mobile width. But it can't show when the width is between [768,1280), please check the snapshots below:

'test' shows

mobile-nav

'test' shows

web-nav

'test' does not show

tablet-nav

@brc-dd
Copy link
Member

brc-dd commented Apr 11, 2024

Add 'test' to '#nav-screen-content-after' slot, it shows under web and mobile width.

No it doesn't. It is only shown on mobile when expanded - https://stackblitz.com/edit/vite-tbadgd?file=docs%2F.vitepress%2Ftheme%2FLayout.vue

image image

@fiwalld
Copy link
Author

fiwalld commented Apr 11, 2024

'#nav-bar-content-after' also not work, so the question will be how can I add custom component after the nav content when the windows resize to [768,1280)?

@fiwalld
Copy link
Author

fiwalld commented Apr 12, 2024

No it doesn't. It is only shown on mobile when expanded - https://stackblitz.com/edit/vite-tbadgd?file=docs%2F.vitepress%2Ftheme%2FLayout.vue

Hi, please check below snapshot about '#nav-bar-content-after'. Any updates? Is it a bug or a new feature need to be done? Thanks!
https://stackblitz.com/edit/vite-cyzwks?file=docs%2F.vitepress%2Ftheme%2FLayout.vue
tablet

@brc-dd
Copy link
Member

brc-dd commented Apr 12, 2024

@brc-dd brc-dd added the has-workaround Has workaround, low priority label Apr 12, 2024
@fiwalld
Copy link
Author

fiwalld commented Apr 13, 2024

you can do something like this - https://stackblitz.com/edit/vite-hqc3bc?file=docs%2F.vitepress%2Ftheme%2FLayout.vue,docs%2F.vitepress%2Ftheme%2FFoo.vue ?

Hi, that is not what I want. I think the foo menu should be folded to the bottom of pop up menus as below when the widow is between [768,1280), any suggetions?
aaa

@fiwalld
Copy link
Author

fiwalld commented Apr 30, 2024

I think it's acceptable for me '#nav-bar-content-after' slot does not move to popup menus automatically when screen size is between 768 and 1280.

@fiwalld fiwalld closed this as not planned Won't fix, can't repro, duplicate, stale Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has-workaround Has workaround, low priority need more info Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants