Skip to content

Commit 7c6230a

Browse files
committed
Revert "fix: sync view headers with scroll"
This reverts commit 0404b3e.
1 parent d490260 commit 7c6230a

File tree

1 file changed

+1
-28
lines changed

1 file changed

+1
-28
lines changed

src/dashboard/Data/Views/Views.react.js

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ class Views extends TableView {
2626
super();
2727
this.section = 'Core';
2828
this.subsection = 'Views';
29-
this.contentRef = React.createRef();
30-
this.headerRef = React.createRef();
31-
this.syncHeaderPosition = this.syncHeaderPosition.bind(this);
3229
this.state = {
3330
views: [],
3431
counts: {},
@@ -52,21 +49,6 @@ class Views extends TableView {
5249
.then(() => this.loadViews(this.context));
5350
}
5451

55-
componentDidMount() {
56-
this.syncHeaderPosition();
57-
window.addEventListener('scroll', this.syncHeaderPosition);
58-
window.addEventListener('resize', this.syncHeaderPosition);
59-
}
60-
61-
componentDidUpdate() {
62-
this.syncHeaderPosition();
63-
}
64-
65-
componentWillUnmount() {
66-
window.removeEventListener('scroll', this.syncHeaderPosition);
67-
window.removeEventListener('resize', this.syncHeaderPosition);
68-
}
69-
7052
componentWillReceiveProps(nextProps, nextContext) {
7153
if (this.context !== nextContext) {
7254
this.props.schema
@@ -192,13 +174,12 @@ class Views extends TableView {
192174
return (
193175
<div>
194176
<LoaderContainer loading={loading}>
195-
<div className={tableStyles.content} ref={this.contentRef}>{content}</div>
177+
<div className={tableStyles.content}>{content}</div>
196178
</LoaderContainer>
197179
{toolbar}
198180
<div
199181
className={tableStyles.headers}
200182
style={{ width: this.state.tableWidth, right: 'auto' }}
201-
ref={this.headerRef}
202183
>
203184
{headers}
204185
</div>
@@ -351,14 +332,6 @@ class Views extends TableView {
351332
this.props.navigate(path);
352333
}
353334

354-
syncHeaderPosition() {
355-
if (!this.headerRef.current || !this.contentRef.current) {
356-
return;
357-
}
358-
const left = this.contentRef.current.getBoundingClientRect().left;
359-
this.headerRef.current.style.left = `${left}px`;
360-
}
361-
362335
showNote(message, isError) {
363336
if (!message) {
364337
return;

0 commit comments

Comments
 (0)