Browse Source

fix: keep the element reference and reset scrollTop on that

pull/7405/head
Pranav C 11 months ago
parent
commit
3ccf1dfd39
  1. 10
      packages/nc-gui/components/smartsheet/expanded-form/index.vue

10
packages/nc-gui/components/smartsheet/expanded-form/index.vue

@ -469,12 +469,14 @@ const isReadOnlyVirtualCell = (column: ColumnType) => {
watch([expandedFormScrollWrapper, isLoading], () => { watch([expandedFormScrollWrapper, isLoading], () => {
if (isMobileMode.value) return if (isMobileMode.value) return
if (expandedFormScrollWrapper.value && !isLoading.value) { const expandedFormScrollWrapperEl = expandedFormScrollWrapper.value
const height = expandedFormScrollWrapper.value.scrollHeight
expandedFormScrollWrapper.value.scrollTop = height if (expandedFormScrollWrapperEl && !isLoading.value) {
const height = expandedFormScrollWrapperEl.scrollHeight
expandedFormScrollWrapperEl.scrollTop = height
setTimeout(() => { setTimeout(() => {
expandedFormScrollWrapper.value.scrollTop = 0 expandedFormScrollWrapperEl.scrollTop = 0
}, 125) }, 125)
} }
}) })

Loading…
Cancel
Save