Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datatable scrollTo bug #5921

Open
5 tasks done
deiiviidas opened this issue May 3, 2024 · 0 comments
Open
5 tasks done

datatable scrollTo bug #5921

deiiviidas opened this issue May 3, 2024 · 0 comments
Labels
untriaged need to sort

Comments

@deiiviidas
Copy link

Describe the bug

while using data-table, and i use scrollTo(:left=X) table resets vertical position to 0, instead of keeping old.

// this code is used for horizontal scrool
if (scroll.value > 0) tableRef.value?.scrollTo({ left: scroll.value })

// as the scrool is triggerred - behaves as unexpected.

so to it to function normally, now i need save vertical position also.. which is useless.

Steps to reproduce

you can do like

setTimeout(() => {
if (scroll.value > 0) tableRef.value?.scrollTo({ left: scroll.value })
}, 100)

// handle scroll event
export const handleScroll = useDebounceFn((event: Event) => {
scroll.value = (event.target as HTMLElement).scrollLeft
}, 250)

<n-data-table
ref="tableRef"
@scroll="handleScroll"
/>

Link to minimal reproduction

null

System Info

latest

Used Package Manager

npm

Validations

@deiiviidas deiiviidas added the untriaged need to sort label May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged need to sort
Projects
None yet
Development

No branches or pull requests

1 participant