Golden-layout: Refresh Golden-Layout size at resize of a DIV container

Created on 8 Nov 2017  路  5Comments  路  Source: golden-layout/golden-layout

I have Golden-Layout inside a DIV that can change its size INDEPENDENTLY by window resize.

If GL would size itself according to DIV container... I would not need anything but it's sized in px and _listens for window resize not generic container resize_... How to solve?

One way could be force refresh of GL size at a given event (not ideal because I have to manually force it but... anyway could be workaround). Any idea?

Backlog Question

Most helpful comment

Hello,
I am facing the same issue, using GL with angular.
The div is updated with angular content but GL is not updating its size accordingly.

When I trigger some re-sizing event (docking tabs for instance), GL size itself correctly.

Could anyone help for this ?

Thanks

All 5 comments

Anyone could help me?

Hello,
I am facing the same issue, using GL with angular.
The div is updated with angular content but GL is not updating its size accordingly.

When I trigger some re-sizing event (docking tabs for instance), GL size itself correctly.

Could anyone help for this ?

Thanks

Up for this!!! ;-)

You may consider using ResizeObserver/MutationObserver to observe size changes of the containing DOM element and call GoldenLayout.updateSize(width, height) in observer callback. This approach worked for me for integration with Phosphor.

ResizeObserver is the way to go, maybe we can add native support in the future.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

panyam picture panyam  路  4Comments

martin31821 picture martin31821  路  3Comments

lstkz picture lstkz  路  5Comments

ldetomi picture ldetomi  路  5Comments

ldetomi picture ldetomi  路  3Comments