[UI] Listen for keyup, keydown and touch events on NameEditor.

This commit is contained in:
Fabio Manganiello 2024-09-05 01:40:26 +02:00
parent 4e5c740908
commit 44e319e7ca
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -1,10 +1,15 @@
<template> <template>
<form @submit.prevent="submit" class="name-editor"> <form @submit.prevent="submit" class="name-editor">
<input type="text" v-model="text" :disabled="disabled" ref="input"> <input type="text"
:disabled="disabled"
v-model="text"
@keydown="proxy"
@keyup="proxy"
ref="input">
<button type="submit"> <button type="submit">
<i class="fas fa-circle-check" /> <i class="fas fa-circle-check" />
</button> </button>
<button class="cancel" @click="$emit('cancel')" @touch="$emit('cancel')"> <button class="cancel" @click="$emit('cancel')">
<i class="fas fa-ban" /> <i class="fas fa-ban" />
</button> </button>
<slot /> <slot />
@ -13,7 +18,7 @@
<script> <script>
export default { export default {
emits: ['input', 'cancel'], emits: ['input', 'cancel', 'keyup', 'keydown'],
props: { props: {
value: { value: {
type: String, type: String,