Also listen to window updates to handle zooming
This commit is contained in:
@@ -56,11 +56,17 @@ class Peers extends React.Component
|
|||||||
|
|
||||||
componentDidMount()
|
componentDidMount()
|
||||||
{
|
{
|
||||||
|
window.addEventListener('resize', this.updateDimensions);
|
||||||
const observer = new ResizeObserver(this.updateDimensions);
|
const observer = new ResizeObserver(this.updateDimensions);
|
||||||
|
|
||||||
observer.observe(this.refs.peers);
|
observer.observe(this.refs.peers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentWillUnmount()
|
||||||
|
{
|
||||||
|
window.removeEventListener('resize', this.updateDimensions);
|
||||||
|
}
|
||||||
|
|
||||||
componentDidUpdate()
|
componentDidUpdate()
|
||||||
{
|
{
|
||||||
this.updateDimensions();
|
this.updateDimensions();
|
||||||
|
|||||||
Reference in New Issue
Block a user