Page MenuHomePhorge

No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None
diff --git a/src/composables/useScrollPosition.js b/src/composables/useScrollPosition.js
index f1d6356d99..6a5e43b182 100644
--- a/src/composables/useScrollPosition.js
+++ b/src/composables/useScrollPosition.js
@@ -1,34 +1,34 @@
import { onMounted, onUnmounted, ref } from 'vue'
export function useScrollPosition() {
const x = ref(0)
const y = ref(0)
const inProgress = ref(false)
const update = (e) => {
x.value = window.scrollX
y.value = window.scrollY
}
onMounted(() => {
window.addEventListener('scroll', update)
update()
})
onUnmounted(() => {
window.removeEventListener('scroll', update)
})
const scrollBy = async (x1, y1, options) => {
inProgress.value = true
await window.scrollBy(x1, y1, options)
inProgress.value = false
}
const scrollIntoView = async (element, options) => {
inProgress.value = true
- await element.scrollIntoView(options)
+ await element.scrollIntoViewIfNeeded(options)
inProgress.value = false
}
return { x, y, scrollBy, scrollIntoView, inProgress }
}

File Metadata

Mime Type
text/x-diff
Expires
Sat, Sep 19, 12:12 PM (1 d, 23 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1767220
Default Alt Text
(1 KB)

Event Timeline