nprapps/pym.js

Box not getting smaller with dynamically changing content (even with sendHeight)

Closed this issue · 2 comments

Hey there,

I have a booking form and after the form is sent the content is removed and a "Thank you" message is shown.
But pym still has a "min-height" within the iframe set on an element (to my surprise pym is not changing the height of the actual container around the iframe but of some container within the iframe).

Basically, height is only increased but never reduced. There are two cases where height should be removed but is not:

  1. you add a customer to the booking form (which removes the input fields). You can see that the footer still stays some space below.
  2. when you acutally make a booking and all context is removed except a message.

Any ideas why that is?

You can see it live in a test environment here:
http://mad-son.de

Thank you for your help :-)

I think I'm seeing the same issue, and I've created a small example on Plunker. When you click on Child 1, Child 2 displays exactly as you'd expect. However, when you click back to Child 1 the iframe never resizes to be smaller. It's based off of the "Resizing after following links in the iframe" example which does become smaller. Is something in the Plunker set up incorrectly?

Page navigation is a stickier issue than the original bug, I think--if you re-use the same iframe, the window height is what it is, at least in Chrome (Firefox doesn't break in your example). If you log out the messages, Pym is sending the same window size back when frame transfers back to the first child, because the browser itself is telling it that the body is that size. I'm not sure what we could do to work around that issue.