aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/src/components/FilesListVirtual.vue
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-05-30 18:05:54 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2024-05-31 17:17:31 +0200
commit0cb32880ee2d40fbe469e6594c35f8324fa4af2b (patch)
treec88fe8993c27b2f89717fc647d36e7abe7dda4e9 /apps/files/src/components/FilesListVirtual.vue
parent975c9e425de65f5eb10a572ef34aa83d82cdd2b2 (diff)
downloadnextcloud-server-0cb32880ee2d40fbe469e6594c35f8324fa4af2b.tar.gz
nextcloud-server-0cb32880ee2d40fbe469e6594c35f8324fa4af2b.zip
refactor(files): Correctly cast table ref to fix TypeScript errors
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/files/src/components/FilesListVirtual.vue')
-rw-r--r--apps/files/src/components/FilesListVirtual.vue13
1 files changed, 7 insertions, 6 deletions
diff --git a/apps/files/src/components/FilesListVirtual.vue b/apps/files/src/components/FilesListVirtual.vue
index af74c6ac5ec..1a5626c687b 100644
--- a/apps/files/src/components/FilesListVirtual.vue
+++ b/apps/files/src/components/FilesListVirtual.vue
@@ -54,13 +54,13 @@
<script lang="ts">
import type { Node as NcNode } from '@nextcloud/files'
-import type { PropType } from 'vue'
+import type { ComponentPublicInstance, PropType } from 'vue'
import type { UserConfig } from '../types'
import { getFileListHeaders, Folder, View, getFileActions, FileType } from '@nextcloud/files'
import { showError } from '@nextcloud/dialogs'
import { loadState } from '@nextcloud/initial-state'
-import { translate as t, translatePlural as n } from '@nextcloud/l10n'
+import { translate as t } from '@nextcloud/l10n'
import { defineComponent } from 'vue'
import { action as sidebarAction } from '../actions/sidebarAction.ts'
@@ -280,18 +280,19 @@ export default defineComponent({
event.preventDefault()
event.stopPropagation()
- const tableTop = this.$refs.table.$el.getBoundingClientRect().top
- const tableBottom = tableTop + this.$refs.table.$el.getBoundingClientRect().height
+ const tableElement = (this.$refs.table as ComponentPublicInstance<typeof VirtualList>).$el
+ const tableTop = tableElement.getBoundingClientRect().top
+ const tableBottom = tableTop + tableElement.getBoundingClientRect().height
// If reaching top, scroll up. Using 100 because of the floating header
if (event.clientY < tableTop + 100) {
- this.$refs.table.$el.scrollTop = this.$refs.table.$el.scrollTop - 25
+ tableElement.scrollTop = tableElement.scrollTop - 25
return
}
// If reaching bottom, scroll down
if (event.clientY > tableBottom - 50) {
- this.$refs.table.$el.scrollTop = this.$refs.table.$el.scrollTop + 25
+ tableElement.scrollTop = tableElement.scrollTop + 25
}
},