Skip to content

Commit

Permalink
Update cell vertical alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
jameskoster committed Jan 12, 2024
1 parent 3c57278 commit 53fff0f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 15 deletions.
11 changes: 10 additions & 1 deletion packages/dataviews/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,16 @@
padding-left: $grid-unit-05;
}
}

tbody {
td {
vertical-align: top;
}
.dataviews-view-table__cell-content-wrapper {
min-height: $grid-unit-40;
display: flex;
align-items: center;
}
}
.dataviews-view-table-header-button {
padding: $grid-unit-05 $grid-unit-10;
font-size: 11px;
Expand Down
34 changes: 20 additions & 14 deletions packages/dataviews/src/view-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -536,17 +536,21 @@ function ViewTable( {
minWidth: 20,
} }
>
<SingleSelectionCheckbox
id={ getItemId( item ) || index }
item={ item }
selection={ selection }
onSelectionChange={
onSelectionChange
}
getItemId={ getItemId }
data={ data }
primaryField={ primaryField }
/>
<span className="dataviews-view-table__cell-content-wrapper">
<SingleSelectionCheckbox
id={
getItemId( item ) || index
}
item={ item }
selection={ selection }
onSelectionChange={
onSelectionChange
}
getItemId={ getItemId }
data={ data }
primaryField={ primaryField }
/>
</span>
</td>
) }
{ visibleFields.map( ( field ) => (
Expand All @@ -560,9 +564,11 @@ function ViewTable( {
field.maxWidth || undefined,
} }
>
{ field.render( {
item,
} ) }
<span className="dataviews-view-table__cell-content-wrapper">
{ field.render( {
item,
} ) }
</span>
</td>
) ) }
{ !! actions?.length && (
Expand Down

0 comments on commit 53fff0f

Please sign in to comment.