Skip to content

Commit

Permalink
fix(ui5-notification-list-group): group header hight is shorter when …
Browse files Browse the repository at this point in the history
…collapsed (#9953)


Removes unnecessary space between collapsed group headers

Fixes: #9911
  • Loading branch information
kskondov authored and kgogov committed Oct 30, 2024
1 parent a26ff05 commit 10e8d2a
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 7 deletions.
3 changes: 2 additions & 1 deletion packages/fiori/src/NotificationListGroupItem.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
@click="{{_onHeaderToggleClick}}"
@keydown="{{_onkeydown}}"
role="button"
aria-expanded="{{_ariaExpanded}}"
aria-expanded="{{_expanded}}"
expanded="{{_expanded}}"
aria-controls="{{_id}}-notificationsList"
title="{{toggleIconAccessibleName}}">
<ui5-icon
Expand Down
2 changes: 1 addition & 1 deletion packages/fiori/src/NotificationListGroupItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class NotificationListGroupItem extends NotificationListItemBase {
return ids.join(" ");
}

get _ariaExpanded() {
get _expanded() {
return !this.collapsed;
}

Expand Down
12 changes: 11 additions & 1 deletion packages/fiori/src/themes/NotificationListGroupItem.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}

.ui5-nli-group-header {
height: calc(2.75rem + 2 * var(--_ui5-notification_group_header-margin));
height: 2.75rem;
position: sticky;
top: 0;
z-index: 90; /* the z-index of the busy-indicator is 99 and the header shouldn't be over it */
Expand All @@ -39,6 +39,11 @@
border-bottom: var(--_ui5-notification_group_header-border-bottom-width) solid var(--sapList_GroupHeaderBorderColor);
box-sizing: border-box;
cursor: pointer;
margin-bottom: var(--_ui5-notification_group_header-margin-expanded)
}

.ui5-nli-group-header[expanded="false"] {
margin-bottom: var(--_ui5-notification_group_header-margin);
}

/* The focus is on the whole group but should be visualized on the Group Header */
Expand All @@ -54,6 +59,11 @@
pointer-events: none;
}

:host([desktop]) .ui5-nli-focusable.ui5-nli-group-root:focus .ui5-nli-group-header[expanded="false"]::before,
.ui5-nli-focusable.ui5-nli-group-root:focus-visible .ui5-nli-group-header[expanded="false"]::before {
margin-bottom: var(--_ui5-notification_group_header-margin);
}

.ui5-nli-group-toggle-icon {
min-width: 1rem;
min-height: 1rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
--_ui5-notification_item-border-radius: 0px;
--_ui5-notification_group_header-border-bottom-width: 0.0625rem;
--_ui5-notification_group_header-margin: 0px;
--_ui5-notification_group_header-margin-expanded: 0.5rem;
--_ui5-notification_group_header-padding: 1rem 0.5rem;
--_ui5-notification_item-state-icon-padding: 0.625rem;
--_ui5-notification_item-border-bottom: var(--ui5-listitem-border-bottom);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:root {
--_ui5-notification_item-border-radius: var(--sapTile_BorderCornerRadius);
--_ui5-notification_group_header-border-bottom-width: 0;
--_ui5-notification_group_header-margin: 0.75rem;
--_ui5-notification_group_header-padding: 0.5rem;
--_ui5-notification_item-state-icon-padding: 0.25rem;
--_ui5-notification_item-border-bottom: var(--sapList_BorderWidth) solid var(--sapList_BorderColor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:root {
--_ui5-notification_item-border-radius: var(--sapTile_BorderCornerRadius);
--_ui5-notification_group_header-border-bottom-width: 0;
--_ui5-notification_group_header-margin: 0.75rem;
--_ui5-notification_group_header-padding: 0.5rem;
--_ui5-notification_item-state-icon-padding: 0.25rem;
--_ui5-notification_item-border-bottom: var(--sapList_BorderWidth) solid var(--sapList_BorderColor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:root {
--_ui5-notification_item-border-radius: var(--sapTile_BorderCornerRadius);
--_ui5-notification_group_header-border-bottom-width: 0;
--_ui5-notification_group_header-margin: 0.75rem;
--_ui5-notification_group_header-padding: 0.5rem;
--_ui5-notification_item-state-icon-padding: 0.25rem;
--_ui5-notification_item-border-bottom: var(--sapList_BorderWidth) solid var(--sapList_BorderColor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:root {
--_ui5-notification_item-border-radius: var(--sapTile_BorderCornerRadius);
--_ui5-notification_group_header-border-bottom-width: 0;
--_ui5-notification_group_header-margin: 0.75rem;
--_ui5-notification_group_header-padding: 0.5rem;
--_ui5-notification_item-state-icon-padding: 0.25rem;
--_ui5-notification_item-border-bottom: var(--sapList_BorderWidth) solid var(--sapList_BorderColor);
Expand Down

0 comments on commit 10e8d2a

Please sign in to comment.