krakenjs / zoid

Cross domain components
Apache License 2.0
2.03k stars 248 forks source link

Resizing container with autoResize does not work #144

Closed ruhusobeje closed 6 years ago

ruhusobeje commented 6 years ago

@bluepnume

In the xcomponent.create I have:

autoResize: { height: true, width: true } But it does not autoresize.

I tried to pass a prop from parent resizeParent:function(){ window.resize('100%', '100%');} Then, calling window.xprops.resizeParent();

I have a react component as child. It is a list of items. I would like to resize parent container once there are more/less items in the child.

But that did not work as well 😟

Thanks!

jelohe commented 6 years ago

I had the same problem with autoResize until i added an element property pointing to a css selector of my embedded app. I couldn't find this behavior on the docs.

autoResize {
  height: true,
  width: true,
  element: '.my-selector'
}
ruhusobeje commented 6 years ago

@jelohe You are the savoir! Worked great. Thanks a lot 😃

ruhusobeje commented 6 years ago

@bluepnume Would you like to add it to docs? Should I make a pull request to add the info?

jelohe commented 6 years ago

148: Let me know if this makes it clear.