antd示例网页上就可以看到:https://mobile.ant.design/components/input-item-cn/。
inputItem类型为phone和bankCard时,如果从前几位开始删除,光标会自动跳转到最后


Hello @jackYouth, your issue has been closed because it does not conform to our issue requirements. Please use the Issue Helper to create an issue, thank you!
input 的 onChange 里面用正则做了对 value 做了处理,会造成 第二次https://github.com/facebook/react/search?q=cursor&type=Issues&utf8=%E2%9C%93
@pingan1927 这里如果不从 react 的角度上找解决办法,还一种就是利用 selection 和 range api 保存与恢复光标位置,不过这个 api 差异和兼容性问题比较复杂
Trace #810
Most helpful comment
input的onChange里面用正则做了对 value 做了处理,会造成 第二次rerender,从而光标的位置被重置了,暂时没什么好方法修复
https://github.com/facebook/react/search?q=cursor&type=Issues&utf8=%E2%9C%93