jdf2e / nutui-react

京东风格的移动端 React 组件库 、支持多端小程序(A React UI Toolkit for Mobile Web)
https://nutui.jd.com/react/
918 stars 263 forks source link

Overlay 类型的组件(Popup, ActionSheet, Picker)在显示时均会导致页面中 ScrollView 重置到顶部 #2744

Closed Aliveing closed 2 days ago

Aliveing commented 1 week ago

NutUI React 包名

@nutui/nutui-react-taro

NutUI React 版本号

2.7.0

平台

weapp

重现链接

https://github.com/Aliveing/nutui-react-taro-demo.git

重现步骤

  1. 滚动上方列表到某个位置(比如 9 在最上方)
  2. 点击「展示弹出层」
  3. 列表重置到顶部(0 在最上方)
  4. 可以切换注释测试 ActionSheet、Picker
  5. Dialog、Popover 展示时不会重置 ScrollView 滚动位置

期望的结果是什么?

弹出层类型的组件,可以不重置 ScrollView

实际的结果是什么?

会导致页面中 ScrollView 重置到顶部

环境信息

👽 Taro v4.0.7

Taro CLI 4.0.7 environment info: System: OS: macOS 15.1 Shell: 5.9 - /bin/zsh Binaries: Node: 20.16.0 - ~/.nvm/versions/node/v20.16.0/bin/node Yarn: 1.22.22 - /opt/homebrew/bin/yarn npm: 10.8.1 - ~/.nvm/versions/node/v20.16.0/bin/npm npmPackages: @tarojs/cli: 4.0.7 => 4.0.7 @tarojs/components: 4.0.7 => 4.0.7 @tarojs/helper: 4.0.7 => 4.0.7 @tarojs/plugin-framework-react: 4.0.7 => 4.0.7 @tarojs/plugin-html: 4.0.7 => 4.0.7 @tarojs/plugin-platform-alipay: 4.0.7 => 4.0.7 @tarojs/plugin-platform-h5: 4.0.7 => 4.0.7 @tarojs/plugin-platform-jd: 4.0.7 => 4.0.7 @tarojs/plugin-platform-qq: 4.0.7 => 4.0.7 @tarojs/plugin-platform-swan: 4.0.7 => 4.0.7 @tarojs/plugin-platform-tt: 4.0.7 => 4.0.7 @tarojs/plugin-platform-weapp: 4.0.7 => 4.0.7 @tarojs/react: 4.0.7 => 4.0.7 @tarojs/runtime: 4.0.7 => 4.0.7 @tarojs/shared: 4.0.7 => 4.0.7 @tarojs/taro: 4.0.7 => 4.0.7 @tarojs/taro-loader: 4.0.7 => 4.0.7 @tarojs/webpack5-runner: 4.0.7 => 4.0.7 babel-preset-taro: 4.0.7 => 4.0.7 eslint-config-taro: 4.0.7 => 4.0.7 react: ^18.0.0 => 18.3.1

其他补充信息

https://github.com/user-attachments/assets/7bb6835a-ce59-4d36-a559-577a320fb47b