Web: Components: Table: fixed header crash

This commit is contained in:
Nikita Gopienko 2021-08-02 11:50:44 +03:00
parent f8673baeb9
commit da6816f04c

View File

@ -33,8 +33,13 @@ class TableHeader extends React.Component {
window.removeEventListener("resize", this.throttledResize);
}
componentDidUpdate() {
this.onResize();
componentDidUpdate(prevProps) {
if (
this.props.sectionWidth !== prevProps.sectionWidth &&
this.props.sectionWidth >= size.tablet + 24
) {
this.onResize();
}
}
getSubstring = (str) => +str.substring(0, str.length - 2);
@ -300,11 +305,6 @@ class TableHeader extends React.Component {
this.headerRef.current.style.width = containerWidth + "px";
localStorage.setItem(columnStorageName, str);
const paddingSize = 24;
if (oldWidth < size.tablet - paddingSize) {
return this.onResize();
}
};
onChange = (checked) => {