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