For a project we’re working on, we’re providing some added functionality through the plugin SDK. In this plugin we open a modal where we expose a customised version of SurveyJS. Since this is contained in a scrollable container we would like it to just expand to fill the height of the modal no matter the screen size. But this doesn’t seem to be possible with the current way the canvas / height resizer is set up.
I looked around for a solution but couldn’t find any good answers on this. Is this something that’s possible with current functionality, potential work-arounds? We also tried making the inside container not scrollable but this just seems to stretch the modal out and doesn’t really do what we want it to do.
Welcome to the forum, and thanks for the question! Sorry, I think you identified a shortcoming in our current modal system… we provide a fullWidth option but not a fullHeight one, which makes it impossible (as far as I can tell) for the iframe to tell what it can expand to. I spent some time trying to find a solution, but ultimately I think browser security measures prevent the iframe from figuring out the parent’s dimensions without explicit cooperation from the parent
For now, I think your only option is to specify a specific pixel height, probably something relatively safe like 700px It won’t fill up the entire viewport height on bigger monitors, unfortunately.
You can also put the survey in a custom page instead of a modal, or maybe just open it in a new tab?
I’ll make a note of this internally… it’s something we should probably support in the modal. I’ll also convert this into a feature request so we can better track it.
No problem, yea I had the same feeling regarding the iframes, they’ll only allow as much as is exposed. The custom page one is worth looking into, I thought modals were the better option since the surveys are linked to an actual model in our CMS setup (a JSON field basically). Would be nice to not be dragged out of the context of the actual record.
I’m glad to hear that it’s something worth looking into though, thanks for confirming this and bringing it up internally!