Comments (6)
Start a new pull request in StackBlitz Codeflow.
from ant-design.
这个问题好坑 🤧
你在例子里的写法存在一个问题,form 的 onChange 更新应该是非高优先级的,你先调用了 setOpen(false) 造成了 value 还没更新 open 已经 false 了,Cascader.Panel 组件就没有 update 了
延迟更新下 就好了
onChange={(e) => {
startTransition(() => setOpen(false));
onChange?.([value[0], e[0]]);
}}
from ant-design.
这个问题好坑 🤧 你在例子里的写法存在一个问题,form 的 onChange 更新应该是非高优先级的,你先调用了 setOpen(false) 造成了 value 还没更新 open 已经 false 了,Cascader.Panel 组件就没有 update 了
延迟更新下 就好了
onChange={(e) => { startTransition(() => setOpen(false)); onChange?.([value[0], e[0]]); }}
setTimeout 大法好,其实问题是,value 设置值后,立刻卸载了 Cascader,导致 Cascader value 有 bug 了,当 value 再设置 undefined 也不会清空 Cascader 选中态,这个 Cascader 需要修复下 bug
from ant-design.
setTimeout 大法好,其实问题是,value 设置值后,立刻卸载了 Cascader,导致 Cascader value 有 bug 了,当 value 再设置 undefined 也不会清空 Cascader 选中态,这个 Cascader 需要修复下 bug
不是的 我 debugger 了 Cascader ,你用的是 From 的 onChange ,没有 useState 更新来的优先级高,Cascader 没有收到更新就被卸载了
from ant-design.
setTimeout 大法好,其实问题是,value 设置值后,立刻卸载了 Cascader,导致 Cascader value 有 bug 了,当 value 再设置 undefined 也不会清空 Cascader 选中态,这个 Cascader 需要修复下 bug
不是的 我 debugger 了 Cascader ,你用的是 From 的 onChange ,没有 useState 更新来的优先级高,Cascader 没有收到更新就被卸载了
但是再加载,value 是undefined,为什么没清空
from ant-design.
但是再加载,value 是undefined,为什么没清空
初始化的时候就是 undefined ,你传进来的 value = undefined,界面显示出来 是因为 Cascader 内部也有一个自己的 value
from ant-design.
Related Issues (20)
- Click propagation on table rows when a modal is clicked
- DatePicker onChange doesn't work for dates on lower edge of disabledDate HOT 1
- CSS Compatible seems to be different in local and in production HOT 1
- menu horizontal 菜单一级菜 key为空字符“” 会一直选中默认选中 HOT 7
- Gap Between Tooltip Content and Arrow When Page is Zoomed HOT 3
- 静态调用message/Modal无法降级:where HOT 4
- Typography.paragraph can't display tooltip HOT 4
- Form.List唯一性校验 HOT 2
- TextArea showCount 和 extra 文字覆盖显示 HOT 2
- rate组件能否禁用键盘默认事件 HOT 1
- Tour组件onClose回调方法current值有误,以及steps多步骤里面的onClose始终调用第一个step的
- Ant Table Sort not working with null values HOT 1
- 关于 Tooltip 的 overlayInnerStyle 属性上添加 css样式 可能会出现闪烁情况 HOT 1
- New component: Toolbar HOT 6
- Dropdown support extra prop HOT 1
- Table 编辑行 ellipsis 失效 HOT 4
- 【bug】表格排序错误的排序出参 HOT 2
- Select组件通过 dropdownRender 自定义虚拟列表 Table, 提示React does not recognize the offsetX prop on a DOM element HOT 5
- 无法使用antd包 HOT 4
- [Wrong statement]Why is component defaultValue not working when inside Form.Item? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ant-design.