Repository navigation
Conversation
saurlax
requested review from
anlyyao,
betavs,
jarmywang,
jin0209,
novlan1 and
zydemail
as code owners
October 29, 2026 06:55
commit: |
Collaborator
TDesign Component Site Preview Open
|
anlyyao
reviewed
Nov 9, 2026
anlyyao
reviewed
Nov 9, 2026
anlyyao
reviewed
Nov 10, 2026
saurlax
force-pushed
the
fix/picker-mouse-wheel
branch
from
November 27, 2026 07:17
b68cd6d to
8a3104f
Compare
Author
|
@anlyyao 谢谢上次的 review!PR 已 rebase 到最新的 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

🤔 这个 PR 的性质是?
🔗 相关 Issue
Related to #3669
💡 需求背景和解决方案
在 #3669 中,维护者说明 Picker 当时主要面向移动端触屏操作。当前微信小程序已提供明确的 PC 专用交互能力:官方 API 定义中,
wx.onKeyDown/wx.onKeyUp(基础库 3.6.0)、wx.onWindowStateChange(3.8.8)和wx.onParallelStateChange(3.12.1)均标注为仅适用于 PC 平台,覆盖键盘输入、窗口状态和分栏场景。参见微信官方 API 定义。这些能力使面向电脑端的交互适配具有实际价值。对于日期、时间及长列表选择,滚轮是桌面用户自然的操作方式;在公共 PickerItem 中补齐滚轮支持,可以让使用这些组件的小程序直接受益,减少业务侧重复适配的成本。本次改动范围限于滚轮选择,保留现有触屏交互和公开 API。上述 PC 专用 API 用于说明平台适配背景,滚轮事件本身的可用性由下述运行时测试验证。
在电脑端使用 Picker 时,鼠标拖动和点击可以切换选项,但滚轮没有响应。DateTimePicker 复用 PickerItem,因此月份、日期和时间列也受到影响。
在 PickerItem 容器增加
catch:wheel事件处理,累积event.detail.deltaY,按itemHeight换算选项移动数量,并将选中索引限制在有效范围内。切换时更新虚拟列表可见区域,复用现有的选中状态与列变化通知逻辑。触摸开始、点击选项或外部值更新时清除残余滚轮位移,避免不同输入方式之间相互影响。无新增公开 API,无须调整现有用法。
验证情况:
git diff --check通过。📝 更新日志
tdesign-miniprogram
@tdesign/uniapp
无变更。
@tdesign/uniapp-chat
无变更。
☑️ 请求合并前的自查清单