Skip to content

Commit

Permalink
fix: anchor links in mobile nav, long menus in Jump Nav (#626)
Browse files Browse the repository at this point in the history
* fixing anchor links in mobile nav

* adding overflow scroll for long jump menu lists
  • Loading branch information
stephiescastle authored Sep 20, 2024
1 parent 13da08b commit 556fd23
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/vue/src/components/BlockHeading/BlockHeading.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default defineComponent({
&:target {
@apply scroll-mt-14;
@screen lg {
@apply scroll-mt-[8rem];
@apply scroll-mt-[7rem];
}
}
}
Expand Down
17 changes: 17 additions & 0 deletions packages/vue/src/components/NavJumpMenu/NavJumpMenu.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,23 @@ export const BaseStory = {
}
}

export const ExtraLong = {
args: {
title: 'Page Title',
jumpLinks: [
...JumpLinksData,
...JumpLinksData,
...JumpLinksData,
...JumpLinksData,
...JumpLinksData,
...JumpLinksData,
...JumpLinksData,
...JumpLinksData
],
invert: true
}
}

export const Light = {
args: {
title: 'Page Title',
Expand Down
1 change: 1 addition & 0 deletions packages/vue/src/components/NavJumpMenu/NavJumpMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
>
<NavJumpMenuContent
:key="index"
class="max-h-[72vh] overflow-y-auto"
:item="item"
v-bind="$attrs"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
:key="child_index"
>
<BaseLink
:to="child.path"
:to="child.path.startsWith('/') ? child.path : undefined"
:href="!child.path.startsWith('/') ? child.path : undefined"
variant="none"
:link-class="linkClass(child, child_index === item.children.length - 1)"
exact
Expand All @@ -35,7 +36,8 @@
class=""
>
<BaseLink
:to="grandchild.path"
:to="grandchild.path.startsWith('/') ? grandchild.path : undefined"
:href="!grandchild.path.startsWith('/') ? grandchild.path : undefined"
variant="none"
:link-class="
nestedLinkClass(
Expand Down

0 comments on commit 556fd23

Please sign in to comment.