fix(UX) auto scroll not working when refresh filteredData
This commit is contained in:
parent
99b84b416d
commit
418a31ce6d
|
@ -291,6 +291,10 @@ function attachScroll() {
|
|||
const config = {childList: true, subtree: true, attributes: true};
|
||||
mutationObserver.observe(vuetifyVirtualScrollBarRef.value, config)
|
||||
}
|
||||
|
||||
if (store.forceToBottom) {
|
||||
scrollToBottom();
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
@ -343,13 +347,6 @@ function scrollToBottom() {
|
|||
});
|
||||
}
|
||||
|
||||
function scrollToTop() {
|
||||
nextTick(() => {
|
||||
vuetifyVirtualScrollBarRef.value.scrollTop = vuetifyVirtualScrollBarRef.value.scrollHeight;
|
||||
// vuetifyVirtualScrollBarRef.value.scrollTo(0, 0);
|
||||
});
|
||||
}
|
||||
|
||||
function formatHexInput(input: string) {
|
||||
// Split the input string on spaces to process each segment separately
|
||||
let str;
|
||||
|
@ -423,11 +420,10 @@ watch(loopSendFreq, (value) => {
|
|||
|
||||
/* patch scroll container does not update clear filter */
|
||||
watch(() => store.filterChanged, (value) => {
|
||||
if (value) {
|
||||
scrollToTop()
|
||||
if (value && store.forceToBottom) {
|
||||
scrollToBottom();
|
||||
store.filterChanged = false;
|
||||
}
|
||||
store.filterChanged = false;
|
||||
})
|
||||
|
||||
watch(() => store.RxRemainHexdump, value => {
|
||||
|
@ -446,6 +442,8 @@ const handleScroll = (ev: Event) => {
|
|||
if (store.forceToBottom) {
|
||||
if (vuetifyVirtualScrollBarRef.value.scrollTop - lastScrollHeight < 0) {
|
||||
store.forceToBottom = false;
|
||||
} else {
|
||||
scrollToBottom();
|
||||
}
|
||||
} else if ((vuetifyVirtualScrollBarRef.value.scrollHeight -
|
||||
vuetifyVirtualScrollBarRef.value.scrollTop) <= vuetifyVirtualScrollBarRef.value.clientHeight) {
|
||||
|
|
Loading…
Reference in New Issue