Skip to content

feat: Picker和PickerView组件增加mouseWheel事件支持 #5052

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

Merged
merged 9 commits into from
Apr 13, 2022

Conversation

shusiwei
Copy link
Contributor

  1. Picker和PickerView组件增加mouseWheel属性
  2. 暴露useLockScroll中的lock&unlock方法
  3. 中英文文档跟进

@codecov
Copy link

codecov bot commented Apr 12, 2022

Codecov Report

Merging #5052 (c130df9) into master (625cbfe) will increase coverage by 1.77%.
The diff coverage is 81.48%.

@@            Coverage Diff             @@
##           master    #5052      +/-   ##
==========================================
+ Coverage   42.23%   44.01%   +1.77%     
==========================================
  Files         277      278       +1     
  Lines        5760     5782      +22     
  Branches     1333     1335       +2     
==========================================
+ Hits         2433     2545     +112     
+ Misses       3101     3025      -76     
+ Partials      226      212      -14     
Impacted Files Coverage Δ
...c/components/date-picker-view/date-picker-view.tsx 0.00% <ø> (ø)
src/components/date-picker/date-picker.tsx 93.54% <ø> (ø)
src/components/picker-view/picker-view.tsx 92.10% <ø> (ø)
src/components/picker/picker.tsx 76.59% <ø> (ø)
src/components/picker-view/wheel.tsx 88.88% <81.48%> (-2.78%) ⬇️
src/locales/zh-HK.ts 100.00% <0.00%> (ø)
src/locales/zh-TW.ts 100.00% <0.00%> (ø)
src/components/image-uploader/image-uploader.tsx 0.00% <0.00%> (ø)
src/locales/ko-KR.ts 100.00% <0.00%> (ø)
src/components/input/input.tsx 67.79% <0.00%> (+18.64%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 625cbfe...c130df9. Read the comment docs.

@shusiwei shusiwei changed the title Picker和PickerView组件增加mouseWheel事件支持 feat: Picker和PickerView组件增加mouseWheel事件支持 Apr 12, 2022
@awmleer awmleer linked an issue Apr 12, 2022 that may be closed by this pull request
@@ -17,6 +17,7 @@ PickerView 是 [Picker](./picker/#picker) 的内容区域。
| defaultValue | 默认选中项 | `PickerValue[]` | `[]` |
| onChange | 选项改变时触发 | `(value: PickerValue[], extend: PickerValueExtend) => void` | - |
| renderLabel | 自定义渲染每列展示的内容 | `(item: PickerColumnItem) => ReactNode` | `(item) => item.label` |
| mouseWheel | 鼠标滚轮模式 | `boolean` | `false` |
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该修正为 启用鼠标滚轮模式

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一次滚动,直接滚动4条数据了

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一次滚动,直接滚动4条数据了

是的,目前依然有这个问题。不知道何时可以解决呢?

Copy link
Contributor Author

@shusiwei shusiwei Mar 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一次滚动,直接滚动4条数据了

是的,目前依然有这个问题。不知道何时可以解决呢?

我刚才提交了个pr,看会不会合并吧 #6853

@@ -17,6 +17,7 @@ PickerView is the content area of [Picker](./picker/#picker).
| defaultValue | Default selected options | `PickerValue[]` | `[]` |
| onChange | Triggered when the options are changed | `(value: PickerValue[], extend: PickerValueExtend) => void` | - |
| renderLabel | The function to custom rendering the label shown on a column | `(item: PickerColumnItem) => ReactNode` | `(item) => item.label` |
| mouseWheel | Support mouse wheel events | `boolean` | `false` |
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该修正为 Enable mouse wheel mode

@awmleer
Copy link
Member

awmleer commented Apr 13, 2022

在你的基础上改了一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

希望为PickerView增加鼠标滚轮支持
4 participants