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

[Slider] range 模式下设置了 value 为 undeifned 时无法操作第二个游标滑块无法拖动 #2618

Open
NWYLZW opened this issue Nov 28, 2023 · 6 comments
Labels
🐞 bug Something isn't working 🎨 design Something about design or style

Comments

@NWYLZW
Copy link
Collaborator

NWYLZW commented Nov 28, 2023

tdesign-react 版本

1.3.1

重现链接

sandbox

重现步骤

设置 Slider 组件为 range,并且不提供默认值(或者提供空数组)

期望结果

正常被拖拽

实际结果

拖拽异常,无法交互

框架版本

18.2.0

浏览器版本

系统版本

Node版本

补充说明

No response

Copy link
Contributor

👋 @NWYLZW,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

Copy link
Contributor

github-actions bot commented Nov 28, 2023

♥️ 有劳 @andyjxli @southorange1228 尽快确认问题。
确认有效后将下一步计划和可能需要的时间回复给 @NWYLZW

@NWYLZW NWYLZW added 🐞 bug Something isn't working 🎨 design Something about design or style labels Nov 28, 2023
@NWYLZW
Copy link
Collaborator Author

NWYLZW commented Nov 28, 2023

限制传入类型?或者支持这俩种特殊情况?

NWYLZW added a commit to zodui/zodui that referenced this issue Nov 28, 2023
@HaixingOoO
Copy link
Collaborator

HaixingOoO commented Nov 29, 2023

限制传入类型?或者支持这俩种特殊情况?

我觉得传值时肯定会知道传什么的,限制传入类型可以ts number[] replace [number,number],支持两种情况会判断过多,第一种用戶用js就没什么用,你觉得呢?

@NWYLZW
Copy link
Collaborator Author

NWYLZW commented Nov 29, 2023

主要有个问题,因为如果要必传 value 的话,外面就必须处理 value 的值了。
比方说如果限制了 value 的范围,那就还要根据这个范围去处理为对应的默认值。
还有限制用户的默认必须传个 value 其实我觉得这种行为并不是很合理,就比如说我现在为了这个问题修改后的代码( zodui/zodui@cbcd37a )其实蛮多余的。

其次的话,我在使用过程中发现 Slider 组件内部并没有值状态,全部依赖的是外部传入,感觉在这里也是有点问题。

@uyarn
Copy link
Collaborator

uyarn commented Nov 30, 2023

其实我觉得支持空数组也挺正常的 🤔

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

No branches or pull requests

3 participants