question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No way to autofocus Widget

See original GitHub issue

Some modalities (like Popup) autofocus when they open, but I can only autofocus the full-screen “embed” form if I use

iframe.contentWindow.postMessage('embed-focus', '*')

However, this is undocumented so feels a bit brittle to me, and I don’t want it to break if something changes about the implementation of the embedded page. Is there a better way?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10

github_iconTop GitHub Comments

3reactions
mathiocommented, Dec 8, 2021

I did some investigation in our typeform renderrer app. When embed-focus event is sent to the form, it enables autofocus, but does not actually focus the form. For example if you were to embed your form with disableAutoFocus option, you could re-enable it by sending this event. I have raised this improvement with the team responsible for renderrer app and will keep you updated here.

1reaction
mathiocommented, Sep 19, 2022

There was an update to the auto focus feature recently: https://github.com/Typeform/embed/pull/521

Now you dont need to post the message manually. You can use the focus() method returned by your embed - eg. from createWidget.

Also, auto focus is disabled by default for widget / standard embeds. It can be enabled via data-tf-auto-focus or autoFocus: true option.

More in my blog post.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Widget auto focus in Embed SDK. | Typeform's Engineering Blog
Typeforms embedded as a widget (standard embed) will no longer auto-focus by default. This change aligns with our “respondent first” ...
Read more >
flutter - AutoFocus isn't working in multiple Stateful widgets ...
The issue -- is that only the first page (that has an autofocus on a TextField widget) is actually getting the focus.
Read more >
autofocus property - Focus class - widgets library - Dart API
Ideally, there is only one widget with autofocus set in each FocusScope. If there is more than one widget with autofocus set, then...
Read more >
First Look at the AutoFocus Portal - Palo Alto Networks
Not all widgets are displayed in the diagram shown above. ... link provides a quick way to send comments and requests for new...
Read more >
Autofocus for Anamorphic! Meet the Focus Tracking Widget!
Join the channel! Unlock the Anamorphic Cookbook:https://www.youtube.com/channel/UC8nvNpXmCZmg_YJFkrQsryw/joinCheck out my Anamorphic ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found