Skip to content

Commit 6b5aa05

Browse files
committed
fix(table): prevent random large font-sizes in iOS & truncate strings
In some scenarios, a table cell could suddenly get a really large font-size. Seemingly this happened when for contents with many characters. However, the issue was not the `font-size` property itself. It was likely due to some Safari-related bug, which had to do with `display: inline-flex` of table cells, and or combination of it with some other styles in Tabulator. Usage of `inline-flex` also caused text not to be truncated in any cells. Both problems are fixed now.
1 parent 3df02c0 commit 6b5aa05

File tree

2 files changed

+13
-17
lines changed

2 files changed

+13
-17
lines changed

src/components/table/partial-styles/_row-selection.scss

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,34 @@
22

33
// .has-rowselector {} // Mabe useful later
44

5+
$checkbox-distance-to-left-edge: 0.5rem;
6+
57
.select-all,
68
.limel-table--row-selector {
7-
--mdc-checkbox-touch-target-size: 1.125rem; // prevent the checkbox affecting the row height
8-
limel-checkbox {
9-
min-height: 1.125rem;
10-
}
9+
// prevent the checkbox affecting the row height
10+
--mdc-checkbox-touch-target-size: 1.125rem;
11+
--mdc-checkbox-ripple-size: 2.5rem;
1112
}
1213

1314
.select-all {
1415
position: absolute;
1516
z-index: $table--limel-table--row-selector;
16-
left: 0;
17+
left: $checkbox-distance-to-left-edge;
1718
top: functions.pxToRem(6);
18-
width: functions.pxToRem(41); // width of the selector column
19-
20-
display: flex !important;
21-
align-items: center;
22-
justify-content: center;
2319
}
2420

2521
.limel-table--row-selector {
2622
position: sticky !important; // otherwise will be overwritten from `.tabulator-row .tabulator-cell`
2723
left: 0;
2824
border-width: 0;
29-
justify-content: center;
3025
z-index: $table--limel-table--row-selector;
31-
padding-right: 0 !important;
32-
padding-left: 0 !important;
26+
27+
text-overflow: unset !important; // Otherwise a `…` will be rendered besides the checkbox, since we truncate all cells
28+
padding-left: $checkbox-distance-to-left-edge !important;
29+
30+
limel-checkbox {
31+
margin-top: functions.pxToRem(1);
32+
}
3333

3434
.tabulator-row-odd & {
3535
background-image: linear-gradient(
@@ -66,7 +66,6 @@
6666

6767
limel-checkbox {
6868
transition: opacity 0.2s ease;
69-
align-self: center;
7069
opacity: 0.3;
7170

7271
.tabulator-row:hover & {

src/components/table/table.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,6 @@ $table--limel-table--row-selector: 1;
120120
padding: $cell-padding;
121121
padding-left: $cell-padding + $width-of-sorter-arrow;
122122

123-
display: inline-flex;
124-
align-items: center;
125123
min-height: inherit;
126124

127125
&[style*='text-align: right;'] {
@@ -140,7 +138,6 @@ $table--limel-table--row-selector: 1;
140138
.tabulator-col,
141139
.tabulator-cell {
142140
max-width: var(--table-max-column-width, 40rem);
143-
font-size: functions.pxToRem(13);
144141
}
145142

146143
#tabulator-loader,

0 commit comments

Comments
 (0)