Auto focus changes in Embed SDK | Community
Skip to main content

Auto focus changes in Embed SDK

  • September 19, 2022
  • 5 replies
  • 148 views

mathio-tf
Typeform
Forum|alt.badge.img+5

Hello friends! 👋

I have noticed the auto focus feature of our Embed SDK is quite a popular topic both here and also on our Github 🚀

Many of you weren't keen on the way auto focus worked. If a typeform was embedded "below the fold" on a web page, it would automatically scroll down to the typeform. I have some good news for you - we've listened to you, and improved this feature. I believe it will make the process of embedding your typeforms even smoother and more straightforward.

 

💡 In short:

  • auto focus is now disabled for widgets (standard embeds) by default

  • no more page jumps for embeds “below the fold”

  • you can enable it again with data-tf-auto-focus / autoFocus: true, for example:
    <div data-tf-widget="HLjqXS5W" data-tf-auto-focus></div>

  • we are exposing focus() method for all embeds so you can focus your typeform programmatically whenever you want (eg. via a button click)

  • I have also prepared an example to give you an idea how to use the new focus() method here: https://tf-widget-focus.glitch.me/

  • If your typeform embed code contains data-tf-disable-auto-focus there is no need to update anything - this option is redundant now, but it is not necessary to remove it and will not affect the functionality


👇 You can read full article on Medium 👇
ttps://mathio28.medium.com/widget-auto-focus-in-embed-sdk-8e0c0584b57

5 replies

Scot
Typeform
Forum|alt.badge.img+3
  • Typeform
  • 19 replies
  • September 19, 2022

 


Gabi Amaral
Ex–Typefomer
Forum|alt.badge.img+5
  • Ex–Typefomer
  • 1778 replies
  • September 20, 2022

Tagging some users that might be interested on this: @daniel @nji @LittleGreenDevelopment @illyb @Seniorpancho 😊


  • Navigating the Land
  • 2 replies
  • October 3, 2024

I have still problem with AutoFocus even it is not turned on in Typeform: My Typeform that is embedded to site as a link (not an embed code) still shows first even it is last thing on an page. Most of my Typeforms don’t do that anymore but there is couple of them that still do. What can be the problem? 


  • Navigating the Land
  • 2 replies
  • October 3, 2024

It does seems like that Auto Focus is on even if you do a new Typeform. I can’t find a way to get it off. 😥

 


mathio-tf
Typeform
Forum|alt.badge.img+5
  • Author
  • Typeform
  • 888 replies
  • October 3, 2024

Hello @Heini R , feel free to share your embed code or the URL of your page here and I can have a look at what’s going on. However if you are not using our embed code / snippet, the issue is most likely elsewhere.


Reply