From cd4f9b08e1434c0578b63d0cd0f2b2ea8019d1d7 Mon Sep 17 00:00:00 2001 From: Nayden Naydenov <31909318+nnaydenow@users.noreply.github.com> Date: Tue, 11 Jun 2024 16:49:31 +0300 Subject: [PATCH] chore: describe correct dependencies (#9174) When a component is using another components in its template, used components must be added to its dependencies in order to get the same scoping. --- packages/main/src/Grid.ts | 9 +++++++-- packages/main/src/GridHeaderRow.ts | 7 ------- packages/main/src/themes/GridHeaderRow.css | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/packages/main/src/Grid.ts b/packages/main/src/Grid.ts index 18d92b59480e..aa885790e770 100644 --- a/packages/main/src/Grid.ts +++ b/packages/main/src/Grid.ts @@ -149,7 +149,11 @@ type GridRowClickEventDetail = { styles: GridStyles, template: GridTemplate, fastNavigation: true, - dependencies: [BusyIndicator, GridCell], + dependencies: [ + BusyIndicator, + GridCell, + GridRow, + ], }) /** @@ -250,7 +254,7 @@ class Grid extends UI5Element { * @default false * @public */ - @property({ type: Boolean, defaultValue: false }) + @property({ type: Boolean }) loading!: boolean; /** @@ -300,6 +304,7 @@ class Grid extends UI5Element { } onBeforeRendering(): void { + this.style.setProperty(getScopedVarName("--ui5_grid_sticky_top"), this.stickyTop); this._refreshPopinState(); } diff --git a/packages/main/src/GridHeaderRow.ts b/packages/main/src/GridHeaderRow.ts index c325d84b80b8..037f7b5ac522 100644 --- a/packages/main/src/GridHeaderRow.ts +++ b/packages/main/src/GridHeaderRow.ts @@ -71,13 +71,6 @@ class GridHeaderRow extends GridRowBase { @property({ type: Boolean }) sticky!: boolean; - onBeforeRendering() { - super.onBeforeRendering(); - if (this._grid) { - this.style.top = this._grid.stickyTop; - } - } - isHeaderRow() { return true; } diff --git a/packages/main/src/themes/GridHeaderRow.css b/packages/main/src/themes/GridHeaderRow.css index 91dea2df997a..861ce99a3133 100644 --- a/packages/main/src/themes/GridHeaderRow.css +++ b/packages/main/src/themes/GridHeaderRow.css @@ -10,7 +10,7 @@ :host([sticky]) { position: sticky; - top: 0; + top: var(--ui5_grid_sticky_top, 0); z-index: 1; }