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

Make sure the input exists #1938

Merged
merged 2 commits into from Oct 2, 2017
Merged

Make sure the input exists #1938

merged 2 commits into from Oct 2, 2017

Conversation

KingMario
Copy link
Contributor

@KingMario KingMario commented Sep 29, 2017

In some case, the input doesn't exist. For example, in http://owfhx5zzh.bkt.clouddn.com/#/, after logged in, if you refresh the page, the username with autofocus prop doesn't exisit.

Login info for http://owfhx5zzh.bkt.clouddn.com/#/
username: Mario, password: password

The error message got from console if you refresh the page:

Uncaught TypeError: Cannot read property 'focus' of undefined
at s.focus (vendor.3a18aedfd787638103a2.js:6)
at s.n [as focus] (vendor.3a18aedfd787638103a2.js:6)
at vendor.3a18aedfd787638103a2.js:6
focus @ vendor.3a18aedfd787638103a2.js:6
n @ vendor.3a18aedfd787638103a2.js:6
(anonymous) @ vendor.3a18aedfd787638103a2.js:6

In some case, the input doesn't exist. For example, in http://owfhx5zzh.bkt.clouddn.com/#/, after logged in, the username is gone after the routing.
http://owfhx5zzh.bkt.clouddn.com/#/
username: Mario, password: password
@KaelWD
Copy link
Member

KaelWD commented Sep 29, 2017

That site doesn't load at all for me, can you reproduce it in a codepen?

@KaelWD KaelWD added the S: needs reproduction The issue does not contain a valid reproduction label Sep 29, 2017
@KingMario
Copy link
Contributor Author

reproduction: https://codepen.io/KingMario/pen/MEorJL

First, you'll be redirected to login route, hit Enter in the username field, then you'll get to the / route.
Now refresh the page, and in console, you'll get the error message:

Uncaught TypeError: Cannot read property 'focus' of undefined
at a.focus (vuetify.min.js:6)
at a.n [as focus] (vue.min.js:6)
at vuetify.min.js:6

@KingMario
Copy link
Contributor Author

A screenshot:
autofocus-error

@@ -158,6 +158,9 @@ export default {
this.$emit('blur', e)
},
focus (e) {
if (!this.$refs.input) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this to one line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@KaelWD KaelWD added pending review The issue is still pending disposition and removed S: needs reproduction The issue does not contain a valid reproduction labels Sep 30, 2017
@johnleider johnleider merged commit 64dad74 into vuetifyjs:dev Oct 2, 2017
@KingMario KingMario deleted the patch-1 branch October 5, 2017 00:07
@lock
Copy link

lock bot commented Apr 16, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please direct any non-bug questions to our Discord

@lock lock bot locked as resolved and limited conversation to collaborators Apr 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pending review The issue is still pending disposition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants