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.

Password input prevent form submitting when press 'enter'

See original GitHub issue

Only text type input : When I press enter, page is refreshing.

<v-form ref="form">
    <v-text-field prepend-icon="person" name="userNameOrEmail" type="text"
        :label="$t('UserNameOrEmailAddress')" 
        v-model="loginInput.userNameOrEmail" 
        :rules="[requiredError]"></v-text-field>
</v-form>

TO MAKE IT WORK: I am adding @submit.prevent="onSubmit"


With password type input : When I press enter, nothing fired.

<v-form ref="form">
    <v-text-field prepend-icon="person" name="userNameOrEmail" type="text"
        :label="$t('UserNameOrEmailAddress')" 
        v-model="loginInput.userNameOrEmail" 
        :rules="[requiredError]"></v-text-field>
    <v-text-field prepend-icon="lock" name="password" type="password"
        :label="$t('Password')" 
        v-model="loginInput.password" 
        :rules="[requiredError]"></v-text-field>
</v-form>

TO MAKE IT WORK: I am adding @keyup.native.enter="onSubmit"


I expect to make them work with same the statement @submit.prevent="onSubmit". But this does not work for form that contains password input and it is refreshing. Is this bug?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jacekkarczmarczykcommented, Nov 23, 2018

I agree that SPA framework should take care of it but Vuetify is not a SPA framework. It’s an UI framework that could be used both in SPA and non-SPA sites

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prevent users from submitting a form by hitting Enter
If you'd like to allow enter key on submit buttons <input|button type="submit"> too, then you can always refine the selector as below. $(document).on("keydown", ......
Read more >
does not submit the form when the "enter button" is pressed on ...
I have a login page with two fields login and password and with a login button. Authorization occurs only when I click on...
Read more >
The Enter Key should Submit Forms, Stop Suppressing it
Basically, if the user hits enter when a text field is focused, the browser should find the first submit button in the form...
Read more >
How to disable form submit on enter button using jQuery
Using the “enter” key: When the user press the “enter” key from the keyboard then the form submit. · Using the “mouse click”:...
Read more >
Javascript: prevent double form submission - The Art of Web
This way when the form is submitted - either by clicking on the submit button or pressing Enter in a text input field...
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