-
Notifications
You must be signed in to change notification settings - Fork 328
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
[Tree] label 属性的 setData
无法触发更新
#2609
Labels
🐞 bug
Something isn't working
compatibility
issue for compatibility
to be published
fixed, not be published
Comments
👋 @NWYLZW,感谢给 TDesign 提出了 issue。 |
|
NWYLZW
changed the title
[Tree] label 属性的
[Tree] label 属性的 Nov 23, 2023
setData
不一定能触发更新setData
无法触发更新
当我尝试在 tdesign-react 项目启动的 start 指令中的开发服务上复现时,这居然是无法触发的。 文件路径在: export default () => <Tree
data={items}
activable
hover
transition
label={(node) => node.data.isEditing
? <input
defaultValue={node.data.label}
onBlur={e => node.setData({ ...node.data, label: e.target.value, isEditing: false })}
onClick={e => e.stopPropagation()}
/>
: <span onDoubleClick={e => {
e.stopPropagation();
node.setData({ ...node.data, isEditing: true });
}}>
{node.data.label}
</span>}
/>; |
经过讨论,可能是由于 common submodule 没有更新导致的 tree node class 的数据响应式关系并未关联上导致的 setData 无法触发数据更新。 |
16 tasks
HaixingOoO
added
to be published
fixed, not be published
and removed
in progress
in progress
labels
Feb 26, 2024
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
compatibility
issue for compatibility
to be published
fixed, not be published
tdesign-react 版本
1.3.1
重现链接
https://codesandbox.io/p/sandbox/tdesign-react-demo-forked-kxz6yc?file=%2Fsrc%2Fdemo.jsx%3A64%2C52
重现步骤
期望结果
setData 设置
isEditing: false
能正常触发渲染并更新数据实际结果
blur 存在可能触发更新视图,而按键事件均不可触发更新视图
框架版本
React(18.2.0)
浏览器版本
Any
系统版本
Any
Node版本
Any
补充说明
No response
The text was updated successfully, but these errors were encountered: