fix: table width overriden with custom styles

when custom styles are passed to Table component, they override the
default width 100%. moving the style out of restProps fixes this issue
while still allows customizing the width if wanted.

Signed-off-by: Heikki Hellgren <heikki.hellgren@op.fi>
This commit is contained in:
Heikki Hellgren
2024-09-14 14:00:43 +03:00
parent 67a57677b7
commit 107a1476b0
2 changed files with 7 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core-components': patch
---
Fixed Table width being overriden by custom styling
@@ -350,6 +350,7 @@ export function Table<T extends object = {}>(props: TableProps<T>) {
onStateChange,
components,
isLoading: loading,
style,
...restProps
} = props;
const tableClasses = useTableStyles();
@@ -483,7 +484,7 @@ export function Table<T extends object = {}>(props: TableProps<T>) {
</>
}
data={tableData}
style={{ width: '100%' }}
style={{ width: '100%', ...style }}
localization={{
toolbar: { searchPlaceholder: 'Filter', searchTooltip: 'Filter' },
...localization,