Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: fixes double style in table #182

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/docs/components/table.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ import {
| horizontalSpacing | `string` | `0` | Yes |
| overrideTableClass | `string` | - | Yes |
| overrideTableContainerClass | `string` | - | Yes |
| wrapperStyle | `CSS Style Object` | - | Yes |
| wrapperClassName | `string` | - | Yes |

The table component renders a `div` that wraps the table to not allow the table to overflow the parent, this can be customized by sending a class to `overrideTableContainerClass`

Expand Down
6 changes: 4 additions & 2 deletions packages/react/src/components/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ const Table: ForwardRefRenderFunction<HTMLTableElement, InitialTableProps> = (
children,
className,
style,
wrapperStyle,
wrapperClassName,
horizontalSpacing = "0",
...nativeProps
},
Expand All @@ -50,9 +52,9 @@ const Table: ForwardRefRenderFunction<HTMLTableElement, InitialTableProps> = (

return (
<div
style={{ ...tableContainerInlineVars, ...(style || {}) }}
style={{ ...tableContainerInlineVars, ...(wrapperStyle || {}) }}
className={`${tableContainerDefaults} ${tableContainerThemeClass} ${overrideTableContainerClass} ${
className || ""
wrapperClassName || ""
}`}
>
<table
Expand Down
4 changes: 3 additions & 1 deletion packages/react/src/components/Table/Table.types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import React, { CSSProperties } from "react";

export interface InitialTableProps
extends React.DetailedHTMLProps<
Expand All @@ -19,6 +19,8 @@ export interface InitialTableProps
overrideTableClass?: string;
className?: string;
horizontalSpacing?: string;
wrapperStyle?: CSSProperties;
wrapperClassName?: string;
}

export type ITableThemeVars = [
Expand Down
Loading