fix: Esc key dismisses tooltip (#1268)

fixes #1267
pull/1283/head
Nolan Lawson 2019-06-03 19:31:00 -07:00 zatwierdzone przez GitHub
rodzic 155cb05e39
commit c397753ddb
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 9 dodań i 0 usunięć

Wyświetl plik

@ -19,6 +19,7 @@
>
{tooltipText}
</span>
<Shortcut scope="global" key="Escape" on:pressed="dismiss()" />
<style>
.tooltip-button {
border-bottom: 1px dotted;
@ -45,6 +46,8 @@
</style>
<script>
import Shortcut from './shortcut/Shortcut.html'
let counter = 0
export default {
@ -66,7 +69,13 @@
if (e.keyCode === 32 || e.keyCode === 13) { // enter or space
this.toggle(e)
}
},
dismiss () {
this.set({ shown: false })
}
},
components: {
Shortcut
}
}
</script>