@@ -43,10 +45,52 @@ const scrollToBottom = () => {
}
}
+// Устанавливаем корректную высоту при загрузке и изменении размера окна
+const onresize = () => {
+ document.documentElement.style.setProperty(
+ '--visual-viewport-offset-top',
+ `${visualViewport!.offsetTop!}px`,
+ )
+ document.documentElement.style.setProperty(
+ '--visual-viewport-height',
+ `${visualViewport!.height}px`,
+ )
+ if (document.activeElement) {
+ if ('scrollIntoViewIfNeeded' in document.activeElement) {
+ ;(document.activeElement.scrollIntoViewIfNeeded as (options?: ScrollIntoViewOptions) => void)(
+ {
+ block: 'center',
+ },
+ )
+ } else {
+ document.activeElement.scrollIntoView({ block: 'center' })
+ }
+ }
+}
+const onresizeOptions: AddEventListenerOptions = { passive: true }
+visualViewport?.addEventListener('resize', onresize, onresizeOptions)
+
const layoutPageHead = useHead({
- htmlAttrs: { class: 'overflow-hidden' },
- bodyAttrs: { class: 'overflow-hidden' },
+ htmlAttrs: { class: 'overflow-hidden overscroll-none touch-none fix-layout-scrolling' },
+ bodyAttrs: { class: 'overflow-hidden overscroll-none touch-none' },
})
-onBeforeUnmount(() => layoutPageHead?.dispose())
+onBeforeUnmount(() => {
+ layoutPageHead?.dispose()
+ visualViewport?.removeEventListener('resize', onresize, onresizeOptions)
+ document.documentElement.style.removeProperty('--visual-viewport-offset-top')
+ document.documentElement.style.removeProperty('--visual-viewport-height')
+})
+
+
diff --git a/apps/frontend/src/main.ts b/apps/frontend/src/main.ts
index 9a4e0a2..8b49c2c 100644
--- a/apps/frontend/src/main.ts
+++ b/apps/frontend/src/main.ts
@@ -36,6 +36,7 @@ const app = createApp(App)
const vueQueryPluginOptions: VueQueryPluginOptions = {
enableDevtoolsV6Plugin: import.meta.env.DEV,
+
queryClientConfig: {
defaultOptions: {
queries: {
@@ -60,7 +61,6 @@ app.use(PrimeVue, {
},
},
})
-app.config.globalProperties.$swDebug = ref([])
app.mount('#app')
diff --git a/apps/frontend/src/style.css b/apps/frontend/src/style.css
index f2d398e..4dfa925 100644
--- a/apps/frontend/src/style.css
+++ b/apps/frontend/src/style.css
@@ -7,8 +7,21 @@
@layer tailwind-utilities {
@tailwind components;
@tailwind utilities;
+ .scroll-touch {
+ -webkit-overflow-scrolling: touch;
+ }
}
-html, body, #app {
+/*html, body, #app {*/
+/* height: 100%;*/
+/* max-height: 100dvh;*/
+/*}*/
+
+
+html {
+ height: 100dvh;
+}
+
+body, #app {
height: 100%;
-}
\ No newline at end of file
+}
diff --git a/apps/frontend/vite.config.ts b/apps/frontend/vite.config.ts
index bc435db..0a8479a 100644
--- a/apps/frontend/vite.config.ts
+++ b/apps/frontend/vite.config.ts
@@ -2,7 +2,7 @@ import { fileURLToPath, URL } from 'node:url'
import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
-import vueDevTools from 'vite-plugin-vue-devtools'
+// import vueDevTools from 'vite-plugin-vue-devtools'
import Components from 'unplugin-vue-components/vite'
import { PrimeVueResolver } from '@primevue/auto-import-resolver'
import Info from 'unplugin-info/vite'
@@ -133,7 +133,7 @@ export default defineConfig(({ mode }) => {
dirs: ['src/components', 'src/layouts'],
}),
- vueDevTools(),
+ // vueDevTools(),
mockData({
mockRoutes: {