From 24d62f6d02dc2eb21f808053c2d4b9b533084a33 Mon Sep 17 00:00:00 2001 From: Sockenklaus Date: Fri, 8 Oct 2021 22:12:40 +0200 Subject: [PATCH] worked on autocomplete modal, solved #1 --- src/components/AddEmployeeModal.vue | 60 ++++++++++++++++++++++------- src/components/Schedule.vue | 5 +-- 2 files changed, 47 insertions(+), 18 deletions(-) diff --git a/src/components/AddEmployeeModal.vue b/src/components/AddEmployeeModal.vue index 584241a..fb0b9ab 100644 --- a/src/components/AddEmployeeModal.vue +++ b/src/components/AddEmployeeModal.vue @@ -4,7 +4,7 @@ div.modal.fade( :id="modalId" tabindex="-1" aria-labelledby="addEmployeeModalLabel" - aria-hidden="false" + aria-hidden="true" data-bs-focus="true" ) .modal-dialog @@ -14,12 +14,15 @@ div.modal.fade( button.btn-close( type="button" aria-label="Close" - @click="closeModal()" + data-bs-dismiss="modal" ) .modal-body - input.form-control( + input.form-control#inputAutocomplete( v-model="query" @input="onChange($event)" + @keypress.enter="onEnter" + @keypress.down="onDown" + @keypress.up="onUp" ) .card.p-0(v-show="isOpenSuggestions") ul.list-group.text-start @@ -27,15 +30,15 @@ div.modal.fade( v-for="(sugg, i) in suggestions" :key="i" @click="setResult(sugg)" + :class="{'active' : selected === i}" ) {{sugg.name}}