diff --git a/src/components/Document/DocumentEntries/DocumentEntries.vue b/src/components/Document/DocumentEntries/DocumentEntries.vue
index 3ad46e2f3c..051e809b60 100644
--- a/src/components/Document/DocumentEntries/DocumentEntries.vue
+++ b/src/components/Document/DocumentEntries/DocumentEntries.vue
@@ -1,6 +1,6 @@
-
+
-import { useTemplateRef } from 'vue'
+import { toValue, useTemplateRef } from 'vue'
import DocumentCard from '@/components/Document/DocumentCard/DocumentCard'
import DocumentFloating from '@/components/Document/DocumentFloating'
@@ -27,7 +27,7 @@ defineProps({
const scrollDocumentCardIntoView = function ({ id, index } = {}) {
const selector = `.document-card[data-entry-id="${id}"][data-entry-index="${index}"]`
- const card = elementRef?.value?.querySelector?.(selector)
+ const card = toValue(elementRef)?.querySelector?.(selector)
if (card) {
// Use nullish coalescing operator to prevent error when document card is not found
card?.scrollIntoView({ behavior: 'auto', block: 'center' })
@@ -35,6 +35,18 @@ const scrollDocumentCardIntoView = function ({ id, index } = {}) {
}
watchDocument(scrollDocumentCardIntoView)
+
+defineExpose({
+ resetSize() {
+ return toValue(elementRef)?.resetSize?.()
+ },
+ resetListSize() {
+ return toValue(elementRef)?.resetStartSize?.()
+ },
+ resetDocumentSize() {
+ return toValue(elementRef)?.resetEndSize?.()
+ }
+})
diff --git a/src/components/Document/DocumentFloating.vue b/src/components/Document/DocumentFloating.vue
index 01c5aad517..fd98c7c513 100644
--- a/src/components/Document/DocumentFloating.vue
+++ b/src/components/Document/DocumentFloating.vue
@@ -82,15 +82,24 @@ function expand(left) {
}
}
-function reset() {
- if (reachedZeroWidth.value || reachedFullWidth.value) {
+function resetSize() {
+ resetStartSize()
+ resetEndSize()
+}
+
+function resetStartSize() {
+ if (reachedZeroWidth.value) {
separatorLineLeft.value = props.minWidth
}
}
-defineExpose({
- reset
-})
+function resetEndSize() {
+ if (reachedFullWidth.value) {
+ separatorLineLeft.value = props.minWidth
+ }
+}
+
+defineExpose({ resetSize, resetStartSize, resetEndSize })
diff --git a/src/components/ScrollTracker.vue b/src/components/ScrollTracker.vue
index 6ed8d674cf..dac6cbbbc5 100644
--- a/src/components/ScrollTracker.vue
+++ b/src/components/ScrollTracker.vue
@@ -42,7 +42,9 @@ export default {
},
scrollToTarget() {
this.hide()
- VueScrollTo.scrollTo(this.target, 200, { offset: this.offset, container: this.container })
+ if (this.target) {
+ VueScrollTo.scrollTo(this.target, 200, { offset: this.offset, container: this.container })
+ }
},
toggle(toggler = !this.visible) {
return toggler ? this.show() : this.hide()
diff --git a/src/views/Search/Search.vue b/src/views/Search/Search.vue
index 729640b4bf..21070b1f0c 100644
--- a/src/views/Search/Search.vue
+++ b/src/views/Search/Search.vue
@@ -1,5 +1,5 @@