Password input prevent form submitting when press 'enter'
See original GitHub issueOnly 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:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top 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 >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 FreeTop 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
Top GitHub Comments
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
You thought wrong https://github.com/vuetifyjs/vuetify/issues/2159#issuecomment-340242836