diff --git a/.changeset/brave-ways-carry.md b/.changeset/brave-ways-carry.md new file mode 100644 index 00000000000..b0dc24804ad --- /dev/null +++ b/.changeset/brave-ways-carry.md @@ -0,0 +1,5 @@ +--- +'@shopify/polaris': patch +--- + +Fixed a bug where `DataTable` summary row would not properly inherit type defined in `columnContentTypes` prop diff --git a/polaris-react/src/components/DataTable/DataTable.tsx b/polaris-react/src/components/DataTable/DataTable.tsx index a62fac6c2e6..ba3689bb8ad 100644 --- a/polaris-react/src/components/DataTable/DataTable.tsx +++ b/polaris-react/src/components/DataTable/DataTable.tsx @@ -852,7 +852,7 @@ class DataTableInner extends PureComponent { }) => { const fixedFirstColumns = this.fixedFirstColumns(); const id = `totals-cell-${index}`; - const {truncate = false, verticalAlign} = this.props; + const {truncate = false, verticalAlign, columnContentTypes} = this.props; let content; let contentType; @@ -862,7 +862,7 @@ class DataTableInner extends PureComponent { } if (total !== '' && index > 0) { - contentType = 'numeric'; + contentType = columnContentTypes[index]; content = total; }