Fixed: Author/Book overview overflows

Bump react-measure to v2.5.2
This commit is contained in:
ta264
2021-04-08 08:55:16 +01:00
parent 106a1c339b
commit a84725f867
15 changed files with 921 additions and 821 deletions
+28 -5
View File
@@ -16,23 +16,46 @@ class Measure extends Component {
// Listeners
onMeasure = _.debounce((payload) => {
this.props.onMeasure(payload);
}, 250, { leading: true, trailing: false })
this.props.onMeasure(payload.bounds);
}, 250, { leading: true, trailing: true })
//
// Render
render() {
const {
className,
style,
onMeasure,
children,
...otherProps
} = this.props;
return (
<ReactMeasure
{...this.props}
/>
bounds={true}
onResize={this.onMeasure}
{...otherProps}
>
{({ measureRef }) => (
<div
ref={measureRef}
className={className}
style={style}
>
{children}
</div>
)}
</ReactMeasure>
);
}
}
Measure.propTypes = {
onMeasure: PropTypes.func.isRequired
className: PropTypes.string,
style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
onMeasure: PropTypes.func.isRequired,
children: PropTypes.node
};
export default Measure;