Chore: Add enter key listener for email input box (#809)

* Chore: Add enter key listener for email input box
This commit is contained in:
Pranav Raj S
2020-05-03 14:45:33 +05:30
committed by GitHub
parent dc6398ab56
commit 19886b40bd

View File

@@ -7,10 +7,11 @@
>
<input
v-model.trim="email"
class="form-input small"
class="form-input"
placeholder="Please enter your email"
:class="{ error: $v.email.$error }"
@input="$v.email.$touch"
@keyup.enter="onSubmit"
/>
<button
class="button"
@@ -68,6 +69,10 @@ export default {
},
methods: {
onSubmit() {
if (this.$v.$invalid) {
return;
}
this.$store.dispatch('message/update', {
email: this.email,
messageId: this.messageId,
@@ -86,8 +91,9 @@ export default {
min-width: 200px;
input {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
border-top-right-radius: 0;
padding: $space-one;
&.error {
border-color: $color-error;