Skip to content

A self-hosted media server and file management system

fix history sidebar scroll

aminnausind184c0e20224
diff --git a/resources/js/layouts/LayoutBase.vue b/resources/js/layouts/LayoutBase.vue
index f9aac8e4..b198fa17 100755
--- a/resources/js/layouts/LayoutBase.vue
+++ b/resources/js/layouts/LayoutBase.vue
@@ -34,7 +34,7 @@ watch(
<div
class="h-screen"
:style="bodyStyles"
- @scroll="
+ @scroll.passive="
(e) => {
if (scrollLock) {
e.preventDefault();
@@ -42,7 +42,7 @@ watch(
}
}
"
- @wheel="
+ @wheel.passive="
(e) => {
if (scrollLock) {
e.preventDefault();
@@ -50,7 +50,7 @@ watch(
}
}
"
- @touchmove="
+ @touchmove.passive="
(e) => {
if (scrollLock) {
e.preventDefault();
@@ -67,7 +67,7 @@ watch(
>
<section
id="left-card"
- :class="`col-span-1 lg:col-span-2 2xl:col-span-1 h-fit order-2 lg:order-1 bg-primary-900 dark:bg-primary-dark-900 dark:text-[#e2e0e2] sm:shadow-xl sm:rounded-2xl space-y-2 scroll-mt-6 ring-gray-900/5 ${selectedSideBar && sideBarTarget === 'left-card' ? 'sm:ring-1' : 'hidden lg:block lg:invisible'}`"
+ :class="`col-span-1 lg:col-span-2 2xl:col-span-1 h-fit order-2 lg:order-1 bg-primary-900 dark:bg-primary-dark-900 dark:text-[#e2e0e2] sm:shadow-xl sm:rounded-2xl space-y-2 sm:scroll-mt-6 ring-gray-900/5 ${selectedSideBar && sideBarTarget === 'left-card' ? 'sm:ring-1' : 'hidden lg:block lg:invisible'}`"
>
<slot name="leftSidebar"></slot>
</section>
@@ -81,7 +81,7 @@ watch(
</section>
<section
id="list-card"
- :class="`col-span-1 lg:col-span-2 2xl:col-span-1 h-fit order-3 bg-primary-900 dark:bg-primary-dark-900 dark:text-[#e2e0e2] sm:shadow-xl sm:rounded-2xl space-y-2 scroll-mt-6 ring-gray-900/5 ${selectedSideBar && sideBarTarget === 'list-card' ? 'sm:ring-1' : 'hidden'}`"
+ :class="`col-span-1 lg:col-span-2 2xl:col-span-1 h-fit order-3 bg-primary-900 dark:bg-primary-dark-900 dark:text-[#e2e0e2] sm:shadow-xl sm:rounded-2xl space-y-2 sm:scroll-mt-6 ring-gray-900/5 ${selectedSideBar && sideBarTarget === 'list-card' ? 'sm:ring-1' : 'hidden'}`"
>
<!-- w-full h-fit lg:w-1/6 lg:max-w-72 sm:min-w-32 shrink-0 -->
<!-- class="bg-primary-900 dark:bg-primary-dark-900 dark:text-[#e2e0e2] shadow-xl p-3 rounded-2xl w-full h-fit lg:w-1/6 lg:max-w-72 sm:min-w-32 shrink-0 space-y-2 scroll-mt-6 z-20 ring-1 ring-gray-900/5" -->
diff --git a/resources/js/stores/AppStore.ts b/resources/js/stores/AppStore.ts
index 7cb2cd63..7666a64b 100644
--- a/resources/js/stores/AppStore.ts
+++ b/resources/js/stores/AppStore.ts
@@ -71,13 +71,13 @@ export const useAppStore = defineStore('App', () => {
if (selectedSideBar.value === target) {
selectedSideBar.value = '';
- document.getElementById('root')?.scrollIntoView({ behavior: 'smooth' });
+ document.getElementById('root')?.scrollIntoView({ behavior: 'smooth', block: 'start' });
return;
}
selectedSideBar.value = target;
if (scrollTarget) {
await nextTick();
- document.getElementById(scrollTarget)?.scrollIntoView({ behavior: 'smooth' });
+ document.getElementById(scrollTarget)?.scrollIntoView({ behavior: 'smooth', block: 'start' });
}
}
diff --git a/resources/js/stores/ContentStore.js b/resources/js/stores/ContentStore.js
index f51e048e..87d57b81 100755
--- a/resources/js/stores/ContentStore.js
+++ b/resources/js/stores/ContentStore.js
@@ -124,7 +124,7 @@ export const useContentStore = defineStore('Content', () => {
if (!limit) fullRecordsLoaded.value = true;
- stateRecords.value = [];
+ // stateRecords.value = [];
const { data, error } = await recordsAPI.getRecords(limit ? `?limit=${limit}` : '');