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

[Cascader] 设置clearable后,点击清除或多次触发onChange事件,并且返回值格式不一致 #2729

Closed
2ue opened this issue Jan 25, 2024 · 5 comments
Labels
🐞 bug Something isn't working to be published fixed, not be published

Comments

@2ue
Copy link
Contributor

2ue commented Jan 25, 2024

tdesign-react 版本

1.5.0

重现链接

https://stackblitz.com/edit/react-9lffvn?file=src%2Fdemo.jsx

重现步骤

设置clearable属性后,点击清除

期望结果

onChange只触发一次

实际结果

只设置clearable,会触发多次onChange事件,会导致onChange逻辑执行多次
在设置了

valueType="full"
showAllLevels
valueMode="onlyLeaf"

属性后,会多次触发onChange事件,并且value值格式不一致

框架版本

18.2.0

浏览器版本

No response

系统版本

No response

Node版本

No response

补充说明

No response

Copy link
Contributor

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

Copy link
Contributor

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

@HaixingOoO
Copy link
Collaborator

好的,看起来是有多次触发的问题,我们尽快修复!!!

@HaixingOoO HaixingOoO added the 🐞 bug Something isn't working label Jan 25, 2024
@2ue
Copy link
Contributor Author

2ue commented Jan 25, 2024

好的,看起来是有多次触发的问题,我们尽快修复!!!

是的,并且在不同的情况下去清除数据,表现的形式还不一致。
image

<Cascader
        options={options}
        onChange={onChange}
        value={value}
        multiple
        clearable
        valueType="full"
        showAllLevels
        valueMode="onlyLeaf"
      />

@HaixingOoO
Copy link
Collaborator

fixed 1.5.2

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

No branches or pull requests

3 participants