EmbeddedEnterprises / ng6-golden-layout

Golden-Layout binding for Angular 6/7/8...
BSD 3-Clause "New" or "Revised" License
60 stars 30 forks source link

Is ng-golden-layout-root necessary? #47

Open rcketscientist opened 5 years ago

rcketscientist commented 5 years ago

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?

martin31821 commented 5 years ago

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.

rcketscientist commented 5 years ago

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.