mirror of
https://github.com/mathuo/dockview
synced 2025-01-23 01:45:58 +00:00
Merge pull request #458 from mathuo/455-floating-groups-lose-size-if-instance-toggled-with-display-none
feat: short-circuit resize calls when display:none
This commit is contained in:
commit
e5334f0fd7
@ -45,6 +45,22 @@ export abstract class Resizable extends CompositeDisposable {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this._element.offsetParent) {
|
||||||
|
/**
|
||||||
|
* offsetParent === null is equivalent to display: none being set on the element or one
|
||||||
|
* of it's parents. In the display: none case the size will become (0, 0) which we do
|
||||||
|
* not want to propagate.
|
||||||
|
*
|
||||||
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent
|
||||||
|
*
|
||||||
|
* You could use checkVisibility() but at the time of writing it's not supported across
|
||||||
|
* all Browsers
|
||||||
|
*
|
||||||
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/checkVisibility
|
||||||
|
*/
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isInDocument(this._element)) {
|
if (!isInDocument(this._element)) {
|
||||||
/**
|
/**
|
||||||
* since the event is dispatched through requestAnimationFrame there is a small chance
|
* since the event is dispatched through requestAnimationFrame there is a small chance
|
||||||
|
Loading…
Reference in New Issue
Block a user