Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blocked autofocusing on a form control error #10976

Closed
johnleider opened this issue Jan 3, 2020 · 3 comments
Closed

blocked autofocusing on a form control error #10976

johnleider opened this issue Jan 3, 2020 · 3 comments

Comments

@johnleider
Copy link

@johnleider johnleider commented Jan 3, 2020

Version

2.6.11

Reproduction link

https://codepen.io/johnjleider/pen/oNgoYda

Steps to reproduce

Open devtools and refresh the pen. You will see warning messages in the console: "Blocked autofocusing on a form control in a cross-origin subframe.".

What is expected?

No warnings

What is actually happening?

Warnings about autofocus


This happens on the latest Chrome (79). The only changes I could find that referenced autofocus in Chrome were here.

Since codepen is rendered in an iframe, the error message is slightly different than if you were to run it locally, but the end result is still the same.

@posva

This comment has been minimized.

Copy link
Member

@posva posva commented Jan 3, 2020

Unfortunately, there is nothing we can do about this, it happens before Vue is even there, even in vanilla JS: https://codepen.io/posva/pen/YzPEQQP?editors=1111
I would say the autofocus is blocked for security reasons and happens to fail in services like CodePen because they use an iframe

@posva posva closed this Jan 3, 2020
@posva

This comment has been minimized.

Copy link
Member

@posva posva commented Jan 3, 2020

Although maybe the error shouldn't happen in a template with type="text". The error also appear on Safari btw

@webdevinci

This comment has been minimized.

Copy link

@webdevinci webdevinci commented Jan 8, 2020

I put some code in to prevent this error on our application (so our customers would quit complaining that there was an error showing in the console)... but I am wondering, is this an actual 'error'? It doesn't seem to break anything, it simply doesn't focus on the element. Shouldn't it be a warning instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.