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

scrollbar bug: can't find props "scrollTo" of dom refrence in current version 2.19.7, but in version 2.19.3, it did。 #1346

Closed
honghuangdc opened this issue Oct 13, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@honghuangdc
Copy link
Contributor

TuSimple/naive-ui version (版本)

2.19.7

Vue version (Vue 版本)

3.2.20

Browser and its version (浏览器及其版本)

Chrome 94.0.4606.81

System and its version (系统及其版本)

MacOS 11.6

Node version (Node 版本)

v14.17.3

Reappearance link (重现链接)

https://github.com/honghuangdc/soybean-admin/blob/main/src/layouts/BasicLayout/index.vue

Reappearance steps (重现步骤)

  1. const scrollbar = ref<HTMLElement | null>(null)
  2. onMouted(() => {
    scrollbar.value?.scrollTo({ left: 0, top: 0 })
    })
    result: in version 2.19.3, it runs normally, but in newer than version 2.19.3, it can't find scrollTop .

Expected results (期望的结果)

scrollTop can run normally

Actual results (实际的结果)

scrollTop can't run

Remarks (补充说明)

@github-actions github-actions bot added the untriaged need to sort label Oct 13, 2021
@Volankey Volankey added bug Something isn't working and removed untriaged need to sort labels Oct 13, 2021
@Volankey
Copy link
Collaborator

Maybe caused by the follow code:
image

@07akioni

@07akioni
Copy link
Collaborator

Maybe caused by the follow code: image

@07akioni

Scrollbar has been a new component wrapped internal component, so some refs is changed.

@07akioni
Copy link
Collaborator

_internal/scrollbar
scrollbar are two things now

@07akioni
Copy link
Collaborator

we can fix it by expose wrap and export internal scrollbar ref

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants