Chore: Add enter key listener for email input box (#809)
* Chore: Add enter key listener for email input box
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user