-
-
Notifications
You must be signed in to change notification settings - Fork 621
fix: pass classNames.body.cell to VirtualCell in virtual mode #1487
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -25,9 +25,9 @@ const BodyLine = React.forwardRef<HTMLDivElement, BodyLineProps>((props, ref) => | |||||||||||||||||||||||||||||
| const { data, index, className, rowKey, style, extra, getHeight, ...restProps } = props; | ||||||||||||||||||||||||||||||
| const { record, indent, index: renderIndex } = data; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| const { scrollX, flattenColumns, prefixCls, fixColumn, componentWidth } = useContext( | ||||||||||||||||||||||||||||||
| const { scrollX, flattenColumns, prefixCls, fixColumn, componentWidth, classNames } = useContext( | ||||||||||||||||||||||||||||||
| TableContext, | ||||||||||||||||||||||||||||||
| ['prefixCls', 'flattenColumns', 'fixColumn', 'componentWidth', 'scrollX'], | ||||||||||||||||||||||||||||||
| ['prefixCls', 'flattenColumns', 'fixColumn', 'componentWidth', 'scrollX', 'classNames'], | ||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||
| const { getComponent } = useContext(StaticContext, ['getComponent']); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
|
|
@@ -103,6 +103,7 @@ const BodyLine = React.forwardRef<HTMLDivElement, BodyLineProps>((props, ref) => | |||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||
| <VirtualCell | ||||||||||||||||||||||||||||||
| key={colIndex} | ||||||||||||||||||||||||||||||
| className={classNames?.body?.cell} | ||||||||||||||||||||||||||||||
| component={cellComponent} | ||||||||||||||||||||||||||||||
| rowInfo={rowInfo} | ||||||||||||||||||||||||||||||
| column={column} | ||||||||||||||||||||||||||||||
|
Comment on lines
+112
to
116
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While adding Additionally, it appears that several required props for
Suggested change
|
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency with the
classNamesfix, you should also extractstylesfromTableContext. This ensures that custom styles defined in thestylesprop of the Table are also correctly applied to cells in virtual mode.