Skip to content

Commit

Permalink
DataViews: Apply width styles to titleField in table layout
Browse files Browse the repository at this point in the history
  • Loading branch information
SainathPoojary committed Feb 13, 2025
1 parent 9b387c8 commit ca275f8
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions packages/dataviews/src/dataviews-layouts/table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,19 @@ function TableRow< Item >( {
</td>
) }
{ hasPrimaryColumn && (
<td>
<td
style={ {
width: titleField?.id
? view.layout?.styles?.[ titleField.id ]?.width
: undefined,
maxWidth: titleField?.id
? view.layout?.styles?.[ titleField.id ]?.maxWidth
: undefined,
minWidth: titleField?.id
? view.layout?.styles?.[ titleField.id ]?.minWidth
: undefined,
} }
>
<ColumnPrimary
item={ item }
level={ level }
Expand Down Expand Up @@ -316,7 +328,23 @@ function ViewTable< Item >( {
</th>
) }
{ hasPrimaryColumn && (
<th scope="col">
<th
scope="col"
style={ {
width: titleField?.id
? view.layout?.styles?.[ titleField.id ]
?.width
: undefined,
maxWidth: titleField?.id
? view.layout?.styles?.[ titleField.id ]
?.maxWidth
: undefined,
minWidth: titleField?.id
? view.layout?.styles?.[ titleField.id ]
?.minWidth
: undefined,
} }
>
<span className="dataviews-view-table-header">
{ titleField && (
<ColumnHeaderMenu
Expand Down

0 comments on commit ca275f8

Please sign in to comment.