fix: console sizing issues (#6540)

fix: console sizing issues (for good)
This commit is contained in:
Calum H.
2026-06-29 14:38:30 +00:00
committed by GitHub
parent 204bd52a5a
commit b09c26f616
8 changed files with 63 additions and 12 deletions
@@ -189,14 +189,31 @@ function handleDocumentPointerDown(event: PointerEvent) {
terminal.value.clearSelection()
}
function handleDocumentKeyDown(event: KeyboardEvent) {
if (!event.metaKey || event.key.toLowerCase() !== 'a') return
const target = event.target as Node | null
const active = document.activeElement
if (
!(target && containerRef.value?.contains(target)) &&
!(active && containerRef.value?.contains(active))
) {
return
}
event.preventDefault()
terminal.value?.selectAll()
}
onMounted(() => {
window.addEventListener('resize', handleWindowResize)
document.addEventListener('pointerdown', handleDocumentPointerDown)
document.addEventListener('keydown', handleDocumentKeyDown, true)
})
onBeforeUnmount(() => {
window.removeEventListener('resize', handleWindowResize)
document.removeEventListener('pointerdown', handleDocumentPointerDown)
document.removeEventListener('keydown', handleDocumentKeyDown, true)
if (resizeDebounce) clearTimeout(resizeDebounce)
})
@@ -38,7 +38,7 @@ const baseId = useId()
<template #popper>
<div class="flex flex-col max-w-[22rem] leading-tight gap-0.5">
<span class="text-contrast mb-1">{{ formatMessage(name, values) }}</span>
<span v-for="message of about" :key="message.id" class="text-primary">
<span v-for="message in about" :key="message.id" class="text-primary">
{{ formatMessage(message, values) }}
</span>
<span v-if="link" class="text-secondary text-xs opacity-80">