Comments (5)
It seems good. welcome PR.
from next.
A great idea!But we also should notice that using Input in Form, if we offer another onChange property such as onFinalValueChange
or onCompositedVauleChange
, in situation of this issue it may be a bit tricky as Form will only use onChange
property. So is it better to offer an API such as composition
to determine when to trigger an change event,if it is true,we will receive the real time value in onChange callback,otherwise we will receive the final value,it's default value is true as compatibility.
from next.
@vicerwang I have thought about implementing it like you said. But if we depend on another boolean prop composition
to call onChange
or not, we have to add some logic in onChange
, and when using Input as a controlled component, the value will not be updated as normal, you can read this article for detail, or loot at the demo I created.
Certainly, using Input in Form is a common case, but I haven't figure out how to archive this without modifying onChange
.
from next.
@ileenhow Thank you for your reply, it seems that my idea is not working due to the limitations of the react. In addition, if we use Input in the Form, the onChange is actually enough, because whether you click the submit button or enter the return, it will trigger onCompositionEnd first, so we always get the final value of the input. Now i think your solution will work well.
from next.
Input can accept the original props to input element.
from next.
Related Issues (20)
- [Tab]tab组件内容被遮挡 HOT 1
- [Select]select组件开启搜索后支持多次全选 HOT 1
- [NumberPicker]在iPad上数值组件单击无法导出键盘 HOT 4
- [Step]1.27.6 以上版本 Step direction 属性不兼容原有 vertical horizontal 值,渲染结果不符合预期
- [List]dataSource的属性无法透传到renderItem HOT 2
- [Switch]Switch无法使用field的默认值 HOT 3
- [Table]使用 lock 时,表头 sort 行为异常 HOT 5
- [Form]form还要使用field管理,反人类操作 HOT 6
- [Tree]Could we set virtualListProps for <Tree> Component? HOT 2
- [Dialog]在 dialog 容器里 使用select 的跟随滚动会存在select弹层被覆盖的问题 HOT 2
- [Upload]Upload.Dragger的itemRender不生效 HOT 3
- [Select]Select组件怎么覆盖无障碍操作 HOT 3
- [Tree]【Tree】组件如何实现点击加载更多 HOT 2
- [Message]Message组件样式问题(icon和文字没有对齐) HOT 3
- [Upload]Upload组件手动上传第一次接口报错后,再点击上传,没有调用接口 HOT 1
- [Message]Dialog 套Message,Message的Icon 会被覆盖掉
- [Field]field.setValue支持传递值泛型 HOT 2
- [TreeSelect]label 超长后会出现没对齐的问题 HOT 2
- [Affix]有没有vue版本的 HOT 4
- [Balloon]Balloon v1,v2版本箭头距元素的间距不一致 HOT 3
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 next.