Issues with iframe size
-
I’m in the process of testing this plugin in a clean WordPress install with just WooCommerce using the Storefront theme and notice some issues regarding the iframe size.
WordPress 4.9.4
WooCommerce 3.3.4
WooCommerce MyParcel 2.4.81) The iframe body tag margin is not reset.
By default browsers apply margin to the body tag (8px in case of IE and Chrome). This causes the content in the iframe to not be horizontally aligned correct with other elements on the page.2) The iframe height is not correctly calculated.
The iframe height is calculated in javascript using document.body.scrollHeight however this does not include margins. As margins are not reset (see previous point) the calculated height is off by 16px which causes a scrollbar to appear in Chrome.3) Then switching between delivery options “Thuis of op het werk bezorgd” and “Ophalen bij een PostNL locatie” a scrollbar can be visible during animation when the content you switch to is larger than the content you come from. This can easily be the case when several options have been enabled like morning and evening delivery.
4) The iframe is not resized when choosing a different pickup point causing a double scrollbar to appear. Now when selecting a pickup point the frame is suddenly resized to the size it should have had in the previous step and also stays at this size which in most cases is too high for what it actually needs. I noticed the list of pickup points is written to the DOM when you want to select a new pickup point but it is not removed or made invisible when you actually select one so its height is included in the iframe height calculation even though it is “off screen”.
As it looks like all files responsible for the iframe resizing behavior are part of the plugin these should be fixable and improve the customer experience. If any of these issue are caused by other means please let me know so I can fix them from my end.
- The topic ‘Issues with iframe size’ is closed to new replies.