Skip to content

Commit 8cd0506

Browse files
fix(ui5-side-navigation): add padding at the end of the text (#11890)
Issue: When the text spans the full length of the item, for example, when it is truncated, there was no padding at the end. Solution: Added padding at the end of the text.
1 parent 95e00fd commit 8cd0506

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

packages/fiori/src/SideNavigationItem.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ class SideNavigationItem extends SideNavigationSelectableItemBase {
175175
get classesArray() {
176176
const classes = super.classesArray;
177177

178-
if (!this.effectiveDisabled && this.sideNavigation?.collapsed && this.items.length) {
178+
if (!this.effectiveDisabled && this.items.length) {
179179
classes.push("ui5-sn-item-with-expander");
180180
}
181181

packages/fiori/src/themes/SideNavigationItem.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717

1818
:host([in-popover]) .ui5-sn-item-level1 .ui5-sn-item-text {
19-
margin: 0 1rem 0 0;
19+
margin: 0 0.375rem 0 0;
2020
line-height: var(--_ui5_side_navigation_popup_title_line_height);
2121
}
2222

packages/fiori/src/themes/SideNavigationItemBase.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,11 @@ and there is an additional border that appears on hover. */
339339
white-space: nowrap;
340340
}
341341

342-
.ui5-sn-item-with-expander .ui5-sn-item-icon::after {
342+
:host(:not([side-nav-collapsed])) .ui5-sn-item:not(.ui5-sn-item-group):not(.ui5-sn-item-with-expander) .ui5-sn-item-text {
343+
padding-inline-end: 0.375rem;
344+
}
345+
346+
:host([side-nav-collapsed]) .ui5-sn-item-with-expander .ui5-sn-item-icon::after {
343347
display: var(--_ui5_side_navigation_triangle_display);
344348
content: "";
345349
width: 0;

packages/fiori/test/pages/SideNavigationWithGroups.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
tooltip="Home tooltip"></ui5-side-navigation-item>
1616
<ui5-side-navigation-group id="group1" expanded text="Group" tooltip="Group tooltip">
1717
<!-- Items -->
18-
<ui5-side-navigation-item text="Home 1"
18+
<ui5-side-navigation-item text="Home 1 lorem ipsum dolor sit amet, consectetur adipiscing elit"
1919
icon="home"
2020
href="#home"
2121
tooltip="Home 1 tooltip"></ui5-side-navigation-item>
@@ -34,7 +34,7 @@
3434
<ui5-side-navigation-sub-item text="Others" selected></ui5-side-navigation-sub-item>
3535
</ui5-side-navigation-item>
3636
<ui5-side-navigation-item href="#locations" text="Locations 2" icon="locate-me"></ui5-side-navigation-item>
37-
<ui5-side-navigation-group expanded text="Group 2">
37+
<ui5-side-navigation-group expanded text="Group 2 lorem ipsum dolor sit amet, consectetur adipiscing elit">
3838
<!-- Items -->
3939
<ui5-side-navigation-item text="Home 1"
4040
icon="home"

0 commit comments

Comments
 (0)