ng6-golden-layout icon indicating copy to clipboard operation
ng6-golden-layout copied to clipboard

Is ng-golden-layout-root necessary?

Open rcketscientist opened this issue 6 years ago • 2 comments

https://github.com/EmbeddedEnterprises/ng6-golden-layout/blob/789bef6e31c9dbe6c4b93ca2730c659aeb1328b6/projects/ngx-golden-layout/src/lib/golden-layout.component.ts#L292

If you injected the root element in the constructor, wouldn't that avoid the extra ViewChild div and potentially some our styling dimension oddities?

rcketscientist avatar Oct 24 '19 23:10 rcketscientist

Can you elaborate on the styling issues? The div should be transparent to all outer styles, but after a quick look, I think we can avoid it.

martin31821 avatar Oct 25 '19 07:10 martin31821

There are some odd interactions with flex. Under certain circumstances GL won't recognize its parent's dimensions. We discussed those a while back.

We also just found a case where window content can blow up the entire golden layout. The following code snippet "fixed" that.

.ng-golden-layout-root {
  flex: 1 1 auto;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

Basically to match parent so we can't cause oddities like this: image

The above image is a GL window, but the content itself managed to push the entire GL outside of the parent bounds (can't see tabs, etc.)

This came from another group and I haven't had time to dig into how they did that at the moment, but removing the extra layer of abstraction can only help.

rcketscientist avatar Oct 25 '19 12:10 rcketscientist