Fix I18n component accessibility
This commit is contained in:
parent
18d852e86f
commit
279040f991
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue