Answered

Embed SDK and iFrame, user cannot escape?

  • 27 September 2023
  • 3 replies
  • 74 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).

icon

Best answer by mathio 28 September 2023, 16:01

View original

3 replies

Userlevel 7
Badge +5

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

Also tagging @mathio for some help!

Userlevel 7
Badge +5

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.

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