Skip to content

Commit

Permalink
Fixing table errors and warnings (#7734)
Browse files Browse the repository at this point in the history
* Fixing table errors and warnings

* Running formatter
  • Loading branch information
SethWelch authored Feb 25, 2025
1 parent a5194c1 commit e7c6e5d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/doc/datatable/rowexpansiondoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export function RowExpansionDoc(props) {
};

const allowExpansion = (rowData) => {
return rowData.orders.length > 0;
return rowData.orders?.length > 0;
};

const rowExpansionTemplate = (data) => {
Expand Down
4 changes: 3 additions & 1 deletion components/lib/datatable/TableFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,13 @@ export const TableFooter = React.memo((props) => {
const rows = React.Children.toArray(ColumnGroupBase.getCProp(props.footerColumnGroup, 'children'));

return rows.map((row, i) => {
const { unstyled, __TYPE, ptOptions, ...rest } = RowBase.getProps(row.props, context);

const rootProps = mergeProps(
{
role: 'row'
},
RowBase.getProps(row.props, context),
unstyled ? { unstyled, ...rest } : rest,
getRowPTOptions(row, 'root')
);

Expand Down
4 changes: 3 additions & 1 deletion components/lib/datatable/TableHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,13 @@ export const TableHeader = React.memo((props) => {
const rows = React.Children.toArray(ColumnGroupBase.getCProp(props.headerColumnGroup, 'children'));

return rows.map((row, i) => {
const { unstyled, __TYPE, ptOptions, ...rest } = RowBase.getProps(row.props, context);

const headerRowProps = mergeProps(
{
role: 'row'
},
RowBase.getProps(row.props, context),
unstyled ? { unstyled, ...rest } : rest,
getRowPTOptions(row, 'root')
);

Expand Down
2 changes: 1 addition & 1 deletion components/lib/multiselect/MultiSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ export const MultiSelect = React.memo(
return value.map((val) => getLabelByValue(val)).join(', ');
}

return value;
return value ? value : '';
};

const visibleOptions = getVisibleOptions();
Expand Down

0 comments on commit e7c6e5d

Please sign in to comment.