Skip to content

fix: also use wrap for navigation-items that are no buttons #4099

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

Merged
merged 8 commits into from
Apr 23, 2025
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
white-space: nowrap; // we don't want to break
text-align: center;
align-items: center; // Centering the content vertically and horizontally
justify-content: space-between;

@include helpers.hover {
background-color: colors.$db-adaptive-bg-basic-transparent-hovered;
Expand All @@ -88,11 +89,9 @@
inline-size: auto;

&[data-wrap="true"] {
.db-navigation-item-expand-button {
&:is(button) {
white-space: normal;
text-align: start;
}
:is(a, .db-navigation-item-expand-button):first-of-type {
white-space: normal;
text-align: start;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,25 @@
[showIcon]="exampleProps?.showIcon"
>
<ng-container *dbNavigationContent>
<a href="#">Test1</a>
Also a navigation item with longer label
</ng-container>
</db-navigation-item>
<db-navigation-item
[icon]="exampleProps?.icon"
[showIcon]="exampleProps?.showIcon"
>
<ng-container *dbNavigationContent>
<a href="#">Test2</a>
<ng-container sub-navigation>
<db-navigation-item
[icon]="exampleProps?.icon"
[showIcon]="exampleProps?.showIcon"
>
<ng-container *dbNavigationContent>
<a href="#">Navigation-Item 2</a>
</ng-container>
</db-navigation-item>
</ng-container>
</db-navigation-item>
<db-navigation-item
[icon]="exampleProps?.icon"
[showIcon]="exampleProps?.showIcon"
>
<ng-container *dbNavigationContent>
<a href="#">Test3</a>
<a href="#">Navigation-Item 1</a>
</ng-container>
</db-navigation-item>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,22 @@ const getNavigationItem = ({
subNavigation={
areaPopup && (
<>
<DBNavigationItem icon={icon} showIcon={showIcon}>
<a href="#">Test1</a>
<DBNavigationItem
icon={icon}
showIcon={showIcon}
subNavigation={
<>
<DBNavigationItem
icon={icon}
showIcon={showIcon}>
<a href="#">Navigation-Item 2</a>
</DBNavigationItem>
</>
}>
Also a navigation item with longer label
</DBNavigationItem>
<DBNavigationItem icon={icon} showIcon={showIcon}>
<a href="#">Test2</a>
<a href="#">Navigation-Item 1</a>
</DBNavigationItem>
</>
)
Expand Down
8 changes: 3 additions & 5 deletions showcases/shared/navigation-item.json
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,10 @@
{
"name": "a",
"native": true,
"content": "Sub-Sub-Navi-Item 1",
"props": {
"href": "#",
"icon": "x_placeholder",
"showIcon": true
},
"content": "True"
"href": "#"
}
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,21 @@ const log = (exampleName?: string) => {
<DBNavigationItem
:icon="exampleProps?.icon"
:showIcon="exampleProps?.showIcon"
><a href="#">Test1</a></DBNavigationItem
>
Also a navigation item with longer label
<template v-slot:sub-navigation>
<DBNavigationItem
:icon="exampleProps?.icon"
:showIcon="exampleProps?.showIcon"
>
<a href="#">Navigation Item 2</a>
</DBNavigationItem>
</template>
</DBNavigationItem>
<DBNavigationItem
:icon="exampleProps?.icon"
:showIcon="exampleProps?.showIcon"
><a href="#">Test2</a></DBNavigationItem
>
<DBNavigationItem
:icon="exampleProps?.icon"
:showIcon="exampleProps?.showIcon"
><a href="#">Test3</a></DBNavigationItem
><a href="#">Navigation Item 1</a></DBNavigationItem
>
</template>
<template v-if="exampleProps?.areaPopup">
Expand Down
Loading