diff --git a/index.html b/index.html index e09dd2e..9218983 100644 --- a/index.html +++ b/index.html @@ -14,7 +14,6 @@
diff --git a/src/App.vue b/src/App.vue index f25e6a4..309dcca 100644 --- a/src/App.vue +++ b/src/App.vue @@ -59,10 +59,19 @@ function setupBackButton() { } } +const isNavVisible = ref(true) + +// Обработчики для показа/скрытия навигации +const hideNav = () => isNavVisible.value = false +const showNav = () => isNavVisible.value = true + + onMounted(() => { toolbarStore.registerHandler("openSpacePicker", () => { isSpaceSelectorVisible.value = true; }); + document.addEventListener('focusin', hideNav) + document.addEventListener('focusout', showNav) if (tgApp.initData) { try { @@ -90,6 +99,8 @@ watch( onBeforeUnmount(() => { toolbarStore.unregisterHandler("openSpacePicker"); + document.removeEventListener('focusin', hideNav) + document.removeEventListener('focusout', showNav) tgApp?.BackButton?.hide(); if (backHandler) tgApp?.BackButton?.offClick(backHandler); }); @@ -111,7 +122,7 @@ onBeforeUnmount(() => {