No way to autofocus Widget
See original GitHub issueSome 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:
- Created 2 years ago
- Comments:10
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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 withdisableAutoFocus
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.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. fromcreateWidget
.Also, auto focus is disabled by default for widget / standard embeds. It can be enabled via
data-tf-auto-focus
orautoFocus: true
option.More in my blog post.