|
@@ -187,14 +187,23 @@ const handleScroll = throttle((e) => {
|
|
|
const canShow = headerElement?.getBoundingClientRect().top <= 0
|
|
|
isFixedHeader.value = canShow
|
|
|
}, 240)
|
|
|
+const handleFocus = () => {
|
|
|
+ const activeElement = document.activeElement
|
|
|
+ if (activeElement) {
|
|
|
+ activeElement.blur()
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
onMounted(() => {
|
|
|
window.addEventListener('scroll', handleScroll)
|
|
|
handleScroll()
|
|
|
+
|
|
|
+ document.addEventListener('visibilitychange', handleFocus)
|
|
|
})
|
|
|
|
|
|
onBeforeMount(() => {
|
|
|
window.removeEventListener('scroll', handleScroll)
|
|
|
+ window.removeEventListener('visibilitychange', handleFocus)
|
|
|
})
|
|
|
|
|
|
const contentId = useRoute().params.id.replace('.html', '')
|