Skip to content
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

[InputItem]输入过快导致光标乱跳 #322

Closed
MeagFu opened this issue Feb 19, 2019 · 10 comments
Closed

[InputItem]输入过快导致光标乱跳 #322

MeagFu opened this issue Feb 19, 2019 · 10 comments
Labels
@Components Components related optimizing Optimize performance or experience

Comments

@MeagFu
Copy link

MeagFu commented Feb 19, 2019

Mand Mobile Version

OS Version & Browser Version

Node Version, Package Management Tool

Recurring Links

Recurring Steps

使用md-input-item组件,设置type="bankCard"
输入过快导致光标乱跳

看了代码,可能是下面的方法导致的
setCursorsPosition
在cursor.js文件

Expectant Behaviors

输入过快也不要乱跳光标

Actual Behaviors

输入过快,光标可能跳到前面

@xxyan0205
Copy link
Collaborator

是否是在pc浏览器?

@MeagFu
Copy link
Author

MeagFu commented Feb 19, 2019

pc浏览器和手机都会出现这样的问题

@xxyan0205
Copy link
Collaborator

具体什么手机,用的什么浏览器

@MeagFu
Copy link
Author

MeagFu commented Feb 19, 2019

是否是在pc浏览器?

pc浏览器和手机都会出现这样的问题

@xxyan0205
Copy link
Collaborator

之前为了做兼容,内部setCursorsPosition 加了setTimeout,导致某些情况下输入过快会出现上述问题,这个我们要想一下优化手段

@MeagFu
Copy link
Author

MeagFu commented Feb 19, 2019

具体什么手机,用的什么浏览器

chrome最新版,这个问题很好复现,比如你同时用几个手指放在键盘下,同时按下,基本就能出现问题

@MeagFu
Copy link
Author

MeagFu commented Feb 19, 2019

之前为了做兼容,内部setCursorsPosition 加了setTimeout,导致某些情况下输入过快会出现上述问题,这个我们要想一下优化手段

对的,我看了你们代码,应该就是setTimeout引起的。

@xxyan0205
Copy link
Collaborator

目前还没找到好的办法,如果有好的思路或方案也欢迎随时PR。

@xxyan0205 xxyan0205 reopened this Feb 20, 2019
@xxyan0205
Copy link
Collaborator

@MeagFu 把你复现问题用到的手机机型及浏览器信息具体描述一下

@MeagFu
Copy link
Author

MeagFu commented Feb 20, 2019

手机:vivo 1724
chrome:71.0.3578.98

使用md-input-item组件,设置type="bankCard"

手机应该是性能不好的就行。
输入的时候一定要快,几个键同时按下

@xxyan0205 xxyan0205 added bug Something isn't working @Components Components related optimizing Optimize performance or experience and removed bug Something isn't working labels Feb 20, 2019
@xxyan0205 xxyan0205 changed the title 输入过快导致光标乱跳 [InputItem]输入过快导致光标乱跳 Feb 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@Components Components related optimizing Optimize performance or experience
Projects
None yet
Development

No branches or pull requests

2 participants