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

fix(NcAppNavigation): Wrap app navigation default slot with scrollable container #5347

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/components/NcAppNavigation/NcAppNavigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ emit('toggle-navigation', {
class="app-navigation__content"
:inert="!open || undefined"
@keydown.esc="handleEsc">
<slot />
<div v-if="$scopedSlots.default" class="app-navigation__body">
<!-- @slot Content within the nav, do NOT add NcModal/NcDialog inside this slot -->
<slot />
</div>

<!-- List for Navigation li-items -->
<ul v-if="$scopedSlots.list" class="app-navigation__list">
<slot name="list" />
Expand Down Expand Up @@ -255,6 +259,17 @@ export default {
position: absolute;
}

&__body {
position: relative;
height: 100%;
width: 100%;
overflow-x: hidden;
overflow-y: auto;
box-sizing: border-box;
display: flex;
flex-direction: column;
}

&__content > ul,
&__list {
position: relative;
Expand Down
8 changes: 1 addition & 7 deletions src/components/NcAppNavigationList/NcAppNavigationList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,11 @@ ul.app-navigation-list { // Increase specificity over NcAppNavigation styles
position: relative;
height: fit-content;
width: 100%;
overflow: unset;
overflow: visible;
box-sizing: border-box;
display: flex;
flex-direction: column;
gap: var(--default-grid-baseline, 4px);
padding: var(--app-navigation-padding);

&:nth-last-of-type(2) {
// Fill remaining space before NcAppNavigation footer
height: 100%;
overflow: auto;
}
}
</style>
Loading