Skip to content

Commit f01cbeb

Browse files
committed
make colspan work
1 parent 8901459 commit f01cbeb

File tree

2 files changed

+9
-31
lines changed

2 files changed

+9
-31
lines changed

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

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ export const gridStyles = css`
182182
183183
[part~='cell'] {
184184
grid-row-start: 1;
185+
grid-column-end: span var(--_colspan, 1);
185186
padding: 0;
186187
box-sizing: border-box;
187188
background: var(--vaadin-grid-cell-background, var(--vaadin-background-color));
@@ -243,31 +244,6 @@ export const gridStyles = css`
243244
/* padding-bottom: var(--_row-border-width); */
244245
}
245246
246-
/* Grid with header */
247-
#table:has(#header > tr:not([hidden])) {
248-
[part~='first-row-cell'] {
249-
/* padding-top: var(--_row-border-width); */
250-
}
251-
}
252-
253-
/* Grid with footer */
254-
#table:has(#footer > tr:not([hidden])) {
255-
[part~='last-row-cell'] {
256-
/* padding-bottom: var(--_row-border-width); */
257-
}
258-
}
259-
260-
/* Grid with header */
261-
#table:has(#header > tr:not([hidden])) {
262-
#emptystatebody {
263-
/* margin-top: calc(var(--_row-border-width) * -1); */
264-
}
265-
266-
#emptystatecell {
267-
/* border-block: var(--_row-border-width) solid transparent; */
268-
}
269-
}
270-
271247
[part~='body-cell'] {
272248
--_highlight-background-color: var(--vaadin-grid-row-highlight-background-color, transparent);
273249
--_highlight-background-image: linear-gradient(
@@ -542,11 +518,11 @@ export const gridStyles = css`
542518
inset-block-start: 0;
543519
}
544520
545-
#table:has(#header > tr:not([hidden])) {
521+
/* #table:has(#header > tr:not([hidden])) {
546522
[part~='first-row']::after {
547523
inset-block-start: 0;
548524
}
549-
}
525+
} */
550526
551527
:host([navigating]) [part~='row']:focus,
552528
:host([navigating]) [part~='cell']:focus {
@@ -598,14 +574,14 @@ export const gridStyles = css`
598574
}
599575
600576
/* Grid with header */
601-
#table:has(#header > tr:not([hidden])) [part~='first-row'][dragover='above']::after {
577+
/* #table:has(#header > tr:not([hidden])) [part~='first-row'][dragover='above']::after {
602578
top: 0;
603-
}
579+
} */
604580
605581
/* Grid with footer */
606-
#table:has(#footer > tr:not([hidden])) [part~='last-row'][dragover='below']::after {
582+
/* #table:has(#footer > tr:not([hidden])) [part~='last-row'][dragover='below']::after {
607583
bottom: 0;
608-
}
584+
} */
609585
610586
[part~='row'][dragstart] {
611587
border-block: var(--_row-border-width) solid transparent !important;

packages/grid/src/vaadin-grid-column-group-mixin.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,12 +313,14 @@ export const GridColumnGroupMixin = (superClass) =>
313313
_colSpanChanged(colSpan, headerCell, footerCell) {
314314
if (headerCell) {
315315
headerCell.setAttribute('colspan', colSpan);
316+
headerCell.style.setProperty('--_colspan', colSpan);
316317
if (this._grid) {
317318
this._grid._a11yUpdateCellColspan(headerCell, colSpan);
318319
}
319320
}
320321
if (footerCell) {
321322
footerCell.setAttribute('colspan', colSpan);
323+
footerCell.style.setProperty('--_colspan', colSpan);
322324
if (this._grid) {
323325
this._grid._a11yUpdateCellColspan(footerCell, colSpan);
324326
}

0 commit comments

Comments
 (0)