Craft 3.5.0 added some new behaviour to Preview, via the Iframe Resizer library.
Unfortunately, there are some issues with the new behaviour and with Iframe Resizer itself (related: https://github.com/craftcms/cms/issues/6643, https://github.com/craftcms/cms/issues/6605, https://github.com/craftcms/cms/issues/6569, multiple mentions on Discord) – specifically, related to some commonly used CSS features like fixed positioning and viewport units.
It's possible to disable Iframe Resizer (effectively reverting to the old Preview behaviour). However, I think it's worth considering if it should actually be disabled by default.
I might be wrong, but I believe the primary reason for using Iframe Resizer is to make Preview able to persist scroll positions across page refreshes for cross-origin preview targets? I would assume cross-origin preview targets aren't relevant for the majority of Craft installs, though. I'd also assume that the majority of sites that actually need cross-origin scroll position persistance are headless setups, for which Preview still won't be able to retain scroll positions quite out of the box (the changelog mentions having to include the Iframe Resizer JS on the page being previewed).
Considering the fairly major caveats involved; if my assumptions above are correct and this isn't a feature the majority of Craft sites actually need, I think it'd make more sense to make Iframe Resizer an opt-in thing at this point in time.
Hm, you may be right. Probably better to explain how to achieve cross-domain scroll retention.
Just added a new useIframeResizer config setting for the next release, which is set to false by default, and the config setting docs explain the tradeoffs.
And since that is now a thing, setting previewIframeResizerOptions to false is no longer a way to disable iFrame Resizer.
Craft 3.5.5 is out now with that new config setting!
Most helpful comment
Just added a new
useIframeResizerconfig setting for the next release, which is set tofalseby default, and the config setting docs explain the tradeoffs.And since that is now a thing, setting
previewIframeResizerOptionstofalseis no longer a way to disable iFrame Resizer.