mirror of
https://github.com/mathuo/dockview
synced 2025-03-12 17:02:04 +00:00
bug: skip resize for unmounted elements
This commit is contained in:
parent
4ad5b0ffe4
commit
19595f3b12
@ -29,6 +29,16 @@ export abstract class Resizable extends CompositeDisposable {
|
|||||||
*/
|
*/
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!document.body.contains(this._element)) {
|
||||||
|
/**
|
||||||
|
* since the event is dispatched through requestAnimationFrame there is a small chance
|
||||||
|
* the component is no longer attached to the DOM, if that is the case the dimensions
|
||||||
|
* are mostly likely all zero and meaningless. we should skip this case.
|
||||||
|
*/
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const { width, height } = entry.contentRect;
|
const { width, height } = entry.contentRect;
|
||||||
this.layout(width, height);
|
this.layout(width, height);
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user