-
Notifications
You must be signed in to change notification settings - Fork 592
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Table): header and body always scroll together while GroupHeader …
…and StickyLock, close 4396 (#4550) * fix(Table): should support Header and Body follow the TableGroupHeader when it locks the columns * fix(Table): delete useless code * fix(Table): adjust test spec for #4396 --------- Co-authored-by: 珵之 <[email protected]>
- Loading branch information
Showing
2 changed files
with
95 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,25 @@ | ||
import React from 'react'; | ||
import { findDOMNode } from 'react-dom'; | ||
import PropTypes from 'prop-types'; | ||
import BodyComponent from '../base/body'; | ||
|
||
export default function ListBody(props) { | ||
return <BodyComponent component="div" {...props} />; | ||
export default class ListBody extends React.Component { | ||
static contextTypes = { | ||
getNode: PropTypes.func, | ||
onFixedScrollSync: PropTypes.func, | ||
}; | ||
|
||
componentDidMount() { | ||
const { getNode } = this.context; | ||
getNode && getNode('body', findDOMNode(this)); | ||
} | ||
|
||
onScroll = e => { | ||
const { onFixedScrollSync } = this.context; | ||
onFixedScrollSync && onFixedScrollSync(e); | ||
}; | ||
|
||
render() { | ||
return <BodyComponent component="div" onScroll={this.onScroll} {...this.props} />; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters