We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent da0c02a commit 233f11aCopy full SHA for 233f11a
src/components/AppContent.vue
@@ -1,14 +1,19 @@
1
<script lang="ts" setup>
2
import { ref, watch } from 'vue'
3
+import { useTauriEvent } from '../composables/useTauriEvent'
4
import { useStore } from '../stores/store'
5
import type { Option } from '../types'
6
+import { batchFn } from '../utils/batch'
7
8
const store = useStore()
9
const mainEl = ref<Option<HTMLElement>>(null)
10
-watch(() => store.currentPage, () => {
11
+const focus = batchFn(() => {
12
mainEl.value?.focus()
-}, { flush: 'post' })
13
+})
14
+
15
+watch(() => store.currentPage, focus, { flush: 'post' })
16
+useTauriEvent('window:hidden', focus)
17
</script>
18
19
<template>
0 commit comments