refactor: improved popover actions, key bindings

This commit is contained in:
Liyas Thomas
2022-10-01 12:22:07 +05:30
parent 1006617e99
commit 1f29ff24d7
33 changed files with 184 additions and 151 deletions

View File

@@ -19,11 +19,10 @@
{{ t("websocket.message") }}
</label>
<tippy
ref="contentTypeOptions"
interactive
trigger="click"
theme="popover"
arrow
:on-shown="() => tippyActions.focus()"
>
<span class="select-wrapper">
<ButtonSecondary
@@ -33,9 +32,9 @@
</span>
<template #content="{ hide }">
<div
class="flex flex-col"
ref="tippyActions"
class="flex flex-col focus:outline-none"
tabindex="0"
role="menu"
@keyup.escape="hide()"
>
<SmartItem
@@ -158,9 +157,10 @@ const emit = defineEmits<{
const t = useI18n()
const toast = useToast()
// Template refs
const tippyActions = ref<any | null>(null)
const linewrapEnabled = ref(true)
const wsCommunicationBody = ref<HTMLElement>()
const contentTypeOptions = ref<Element>()
const payload = ref<HTMLInputElement>()
const prettifyIcon = refAutoReset<Component>(IconWand, 1000)