-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[Taro next]input光标位置不对 #6632
Comments
这样能不能解决问题? <Input value={this.state.value} onInput={this.onInput} cursor={this.state.value.length} /> |
这样子光标在文本中间时候,输入会导致光标跳动吧 |
@Chen-jj 3.0.0-rc.6,ios 下光标依然总是在最左边。 |
yuche 大佬的方案使用后一切正常。 |
@SyMind 不绑定默认值的话,会出现楼主提出的问题,虽然用户可以通过开发者编码实现,但框架层面处理的话不会增加心智负担和额外工作。
百度的话的确存在这个问题,我们把百度的 cusor 默认值去掉。 |
@Chen-jj 我想,微信小程序的文档和百度小程序的文档中,input 组件的默认值都是 undefined。从有小程序开发经验的开发者的角度看,会对其有路径依赖吧,从这个角度看这种改动破坏了这些人的直觉。 可能这样解决比较好,将 cursor 移动到需要 'i.value.length' 作为默认值的小程序对应的插件中,例如微信小程序,而不是对百度小程序做特殊处理。 |
没懂什么意思
最后定位到,也不是 cursor、selection-start、selection-end 的问题,是在百度中当 input 的 id 以 模板用 sjs 处理一下 input 的 id 即可。 |
@Chen-jj 哦哦哦,能询问一下你是如何定位到这个问题的么? |
不断调试 input 的模板属性 |
问题描述
iOS
下,有初始值的input首次聚焦,光标会在最左边。版本:rc.3,在1.3.22中试过没有这个问题。
复现步骤
期望行为
光标位置在文本末端
报错信息
系统信息
补充信息
The text was updated successfully, but these errors were encountered: