1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

Merge branch 'master' of https://github.com/antares-sql/antares into new-connection-management

This commit is contained in:
2022-07-04 17:25:37 +02:00
5 changed files with 54 additions and 7 deletions

View File

@ -156,7 +156,7 @@
</template>
<script setup lang="ts">
import { computed, Ref, ref } from 'vue';
import { computed, onBeforeUnmount, Ref, ref } from 'vue';
import { storeToRefs } from 'pinia';
import { useI18n } from 'vue-i18n';
import { useFocusTrap } from '@/composables/useFocusTrap';
@ -252,8 +252,8 @@ const confirmDeleteConnection = () => {
};
const onKey = (e: KeyboardEvent) => {
e.stopPropagation();
if (e.key === 'Escape') {
e.stopPropagation();
if ((e.target as HTMLInputElement).tagName === 'INPUT' && searchTerm.value.length > 0)
searchTerm.value = '';
else
@ -261,7 +261,11 @@ const onKey = (e: KeyboardEvent) => {
}
};
window.addEventListener('keydown', onKey, { capture: true });
window.addEventListener('keydown', onKey);
onBeforeUnmount(() => {
window.removeEventListener('keydown', onKey);
});
</script>
<style lang="scss" scoped>