Skip to content

Commit 1df6c59

Browse files
committed
wip
1 parent 1cf6dfd commit 1df6c59

File tree

2 files changed

+24
-20
lines changed

2 files changed

+24
-20
lines changed

packages/grid/src/styles/vaadin-grid-base-styles.js

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -163,30 +163,24 @@ export const gridStyles = css`
163163
164164
/* Row and cell borders */
165165
166-
/* stylelint-disable-next-line no-duplicate-selectors */
167-
#header,
168-
#footer {
169-
&::before {
170-
position: absolute;
171-
inset-inline: 0;
172-
border-block: var(--_row-border-width) solid var(--_border-color);
173-
transform: translateX(var(--_grid-horizontal-scroll-position));
174-
}
166+
[part~='last-header-row']::before,
167+
[part~='first-footer-row']::before {
168+
position: absolute;
169+
inset-inline: 0;
170+
border-block: var(--_row-border-width) var(--_border-color);
171+
transform: translateX(var(--_grid-horizontal-scroll-position));
175172
}
176173
177-
#table[has-header] #header {
178-
:host([overflow~='top']) &::before {
179-
content: '';
180-
inset-block-end: calc(var(--_row-border-width) * -1);
181-
}
174+
:host([overflow~='top']) [part~='last-header-row']::before {
175+
inset-block-end: calc(var(--_row-border-width) * -1);
176+
border-block-end-style: solid;
182177
}
183178
184-
#table[has-footer] #footer {
185-
:host([overflow~='bottom']) &::before,
186-
:host(:not([overflow~='top'])) &::before {
187-
content: '';
188-
inset-block-start: calc(var(--_row-border-width) * -1);
189-
}
179+
:host([overflow~='bottom']) [part~='first-footer-row']::before,
180+
:host(:not([overflow~='top'])) #scroller:not([empty-state]) [part~='first-footer-row']::before {
181+
inset-block-start: calc(var(--_row-border-width) * -1);
182+
border-block-start-style: solid;
183+
content: '';
190184
}
191185
192186
[part~='body-row'] {

packages/grid/src/vaadin-grid-scroll-mixin.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,16 @@ export const ScrollMixin = (superClass) =>
454454
// Update the horizontal scroll position property of the focused row
455455
this.__updateRowScrollPositionProperty(focusedRow);
456456
}
457+
458+
const lastHeaderRow = this.$.header.querySelector("[part~='last-header-row']");
459+
if (lastHeaderRow) {
460+
this.__updateRowScrollPositionProperty(lastHeaderRow);
461+
}
462+
463+
const firstFooterRow = this.$.footer.querySelector("[part~='first-footer-row']");
464+
if (firstFooterRow) {
465+
this.__updateRowScrollPositionProperty(firstFooterRow);
466+
}
457467
}
458468

459469
/**

0 commit comments

Comments
 (0)