Fix I18n component accessibility

This commit is contained in:
Chocobozzz 2023-03-01 16:35:05 +01:00
parent 18d852e86f
commit 279040f991
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 26 additions and 11 deletions

View File

@ -1,12 +1,13 @@
<template>
<div class="interface-language-dropdown">
<button @click="toggleShow()">
<img
:title="imgTitle"
class="interface-language"
src="/img/interface-languages.svg"
alt="Change interface language"
@click="toggleShow()"
>
</button>
<div
v-if="showMenu"
@ -57,9 +58,15 @@
}
},
mounted () {
document.addEventListener('keydown', event => {
if (event.key === 'Escape') this.showMenu = false
});
},
methods: {
toggleShow () {
this.showMenu = !this.showMenu;
this.showMenu = !this.showMenu
},
buildLanguageRoute (locale: string | number) {
@ -73,10 +80,18 @@
@import '../scss/_variables';
.interface-language-dropdown {
> button {
border: none;
padding: 0;
background: transparent;
width: inherit;
img {
cursor: pointer;
opacity: .7;
}
}
.menu {
z-index: 10;