Skip to content

Commit

Permalink
Fix matrix's row text show twice in modern, default theme (#7926)
Browse files Browse the repository at this point in the history
  • Loading branch information
dk981234 authored Mar 5, 2024
1 parent 82f939d commit 54b0f0b
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/defaultCss/cssmodern.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ export var modernCss = {
cell: "sv-table__cell",
headerCell: "sv-table__cell sv-table__cell--header",
row: "sv-table__row",
rowTextCell: "sv-table__cell--row-text",
rowAdditional: "sv-table__row--additional",
detailRow: "sv-table__row--detail",
detailRowText: "sv-table__cell--detail-rowtext",
Expand Down
1 change: 1 addition & 0 deletions src/defaultCss/cssstandard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ export var defaultStandardCss = {
headerCell: "sv_matrix_cell_header",
row: "sv_matrix_row",
rowAdditional: "sv-matrix__row--additional",
rowTextCell: "sv-table__cell--row-text",
detailRow: "sv_matrix_detail_row",
detailRowText: "sv_matrix_cell_detail_rowtext",
detailCell: "sv_matrix_cell_detail",
Expand Down
5 changes: 5 additions & 0 deletions src/main.m600.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
content: attr(data-responsive-title);
}
}
.sv-table__cell--row-text {
&::before {
content: none;
}
}
}

table.sv_q_matrix {
Expand Down
5 changes: 5 additions & 0 deletions src/modern.m600.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@
content: attr(data-responsive-title);
}
}
.sv-table__cell--row-text {
&:before {
content: none;
}
}
}

table.sv-matrix-root {
Expand Down
8 changes: 4 additions & 4 deletions tests/markup/snapshots/martix-celltype-text-a11y.snap.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</thead>
<tbody>
<tr class="sv_matrix_row" data-sv-drop-target-matrix-row="testid0row1">
<td class="sv_matrix_cell" colspan="1" data-responsive-title="Age 0-4" title="">
<td class="sv_matrix_cell sv-table__cell--row-text" colspan="1" data-responsive-title="Age 0-4" title="">
<span class="sv-string-viewer">Age 0-4</span>
</td>
<td class="sv_matrix_cell" colspan="1" data-responsive-title="Number of people" title="Number of people">
Expand All @@ -21,7 +21,7 @@
</td>
</tr>
<tr class="sv_matrix_row" data-sv-drop-target-matrix-row="testid0row3">
<td class="sv_matrix_cell" colspan="1" data-responsive-title="Age 5-11" title="">
<td class="sv_matrix_cell sv-table__cell--row-text" colspan="1" data-responsive-title="Age 5-11" title="">
<span class="sv-string-viewer">Age 5-11</span>
</td>
<td class="sv_matrix_cell" colspan="1" data-responsive-title="Number of people" title="Number of people">
Expand All @@ -31,7 +31,7 @@
</td>
</tr>
<tr class="sv_matrix_row" data-sv-drop-target-matrix-row="testid0row5">
<td class="sv_matrix_cell" colspan="1" data-responsive-title="Age 12-15" title="">
<td class="sv_matrix_cell sv-table__cell--row-text" colspan="1" data-responsive-title="Age 12-15" title="">
<span class="sv-string-viewer">Age 12-15</span>
</td>
<td class="sv_matrix_cell" colspan="1" data-responsive-title="Number of people" title="Number of people">
Expand All @@ -41,7 +41,7 @@
</td>
</tr>
<tr class="sv_matrix_row" data-sv-drop-target-matrix-row="testid0row7">
<td class="sv_matrix_cell" colspan="1" data-responsive-title="Age 16+" title="">
<td class="sv_matrix_cell sv-table__cell--row-text" colspan="1" data-responsive-title="Age 16+" title="">
<span class="sv-string-viewer">Age 16+</span>
</td>
<td class="sv_matrix_cell" colspan="1" data-responsive-title="Number of people" title="Number of people">
Expand Down
6 changes: 3 additions & 3 deletions tests/question_matrixdynamictests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6897,7 +6897,7 @@ QUnit.test("Detail panel, rendered table and className", function (assert) {

assert.equal(
rows[1].cells[1].className,
"sv_matrix_cell sv_matrix_cell_detail_rowtext",
"sv_matrix_cell sv-table__cell--row-text sv_matrix_cell_detail_rowtext",
"row text css"
);
assert.equal(
Expand Down Expand Up @@ -7211,8 +7211,8 @@ QUnit.test("Row actions, rendered table and className", function (assert) {
leftActions[0] instanceof Action,
"actions in cell are instances of Action"
);
assert.equal(rows[1].cells[1].className, "sv_matrix_cell", "text cell");
assert.equal(rows[1].cells[1].className, "sv_matrix_cell", "ordinary cell");
assert.equal(rows[1].cells[1].className, "sv_matrix_cell sv-table__cell--row-text", "text cell");
assert.equal(rows[1].cells[2].className, "sv_matrix_cell", "ordinary cell");
assert.equal(
rows[1].cells[3].className,
"sv_matrix_cell sv_matrix_cell_actions",
Expand Down

0 comments on commit 54b0f0b

Please sign in to comment.