Embed SDK and iFrame, user cannot escape? | Community
Skip to main content
Answered

Embed SDK and iFrame, user cannot escape?

  • September 27, 2023
  • 3 replies
  • 102 views

Hello! 

 

I’d like to host a typeform in a full-screen iFrame (for various reasons). I’m using the embed SDK for this. 

 

The issue is that when the user clicks the “Escape” key, they aren’t prompted to exit the typeform. I have to manually create a div of an “exit” button that displays on the top of the screen to enable the user to escape / close the typeform.

 

I’ve also had to manually add function “close” to close the iframe using the data-tf-on-ending-button-click hook.

 

This is a sub-par user experience. I’d like the user to be able to escape the form by simply pressing escape. Is there an easy way to do this? (I also can’t just listen for the escape key, because the typeform iframe captures all keyboard events).

Best answer by mathio-tf

Hello @rohan 

full screen embeds are intended to be displayed full screen as the only content on the page.

You might like the popup embed type to display your typeform in a closable modal window. The popup is closable via “escape” key.

View original

3 replies

Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14840 replies
  • September 27, 2023

Hi @rohan Do you mind sharing the URL where you have the form embedded? 

Also tagging @mathio for some help!


mathio-tf
Typeform
Forum|alt.badge.img+5
  • Typeform
  • 888 replies
  • Answer
  • September 28, 2023

Hello @rohan 

full screen embeds are intended to be displayed full screen as the only content on the page.

You might like the popup embed type to display your typeform in a closable modal window. The popup is closable via “escape” key.


  • Author
  • Explorer
  • 2 replies
  • September 28, 2023

Thanks @mathio !

 

I was able to accomplish what I was trying to do with a combination of the popup embed type, data-tf-open="load", and the data-tf-on-close attribute.


Reply