Skip to content

Commit

Permalink
fix(SelectUnitModal): fix search for mobile devices
Browse files Browse the repository at this point in the history
  • Loading branch information
rudnovd committed Apr 6, 2022
1 parent 90e7c7b commit 413f676
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/SelectUnitModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
<template #header>
<input
ref="searchInput"
v-model="search"
:value="search"
type="text"
class="search-input"
:placeholder="t('components.selectUnitModal.searchCreature')"
@keyup.enter="selectFirstFounded"
@input="searchCreature"
/>
</template>

Expand Down Expand Up @@ -139,6 +140,11 @@ export default defineComponent({
context.emit('close')
}
const searchCreature = (event: Event) => {
const target = event.currentTarget as HTMLInputElement
search.value = target.value
}
return {
t,
Expand All @@ -151,6 +157,7 @@ export default defineComponent({
selectUnit,
selectFirstFounded,
onClose,
searchCreature,
}
},
})
Expand Down

0 comments on commit 413f676

Please sign in to comment.