vuejs / vue

This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
http://v2.vuejs.org
MIT License
207.68k stars 33.67k forks source link

this.$nextTick don't work fine in (android 5.1.1)android webview 55.0.2883.91. #9992

Open Trendymen opened 5 years ago

Trendymen commented 5 years ago

Version

2.6.10

Reproduction link

https://codesandbox.io/embed/k36zj3z5o7

Browser info

android 5.1.1 android system webview 55.0.2883.91.

Steps to reproduce

input phone number more than 3.

What is expected?

when i input phone number more than 3 ,the position of cursor will be the last .

What is actually happening?

when i input phone number more than 3 ,the position of cursor is not on the last.I suppose the reason is the bug of microtask in this version of android webview.

posva commented 5 years ago

I don't understand what you expect to happen. This is what happen on Android 5.1:

ScreenFlow

the same happens on desktop Chrome 55

Trendymen commented 5 years ago

I don't understand what you expect to happen. This is what happen on Android 5.1:

ScreenFlow

the same happens on desktop Chrome 55

i'm sorry about that i can't reproduct too before, i have updated the codesandbox link, please check it one more.

This is the what happen on my test phone-Samsung Galaxy J3 Pro :

20190508_210103

posva commented 5 years ago

It still doesn't reproduce on Chrome 55 nor android 5.1 What is the bug of microtask you are talking about?

Trendymen commented 5 years ago

It still doesn't reproduce on Chrome 55 nor android 5.1 What is the bug of microtask you are talking about?

Sorry, maybe i can't explain why i think it's a bug of microTask, but i supposed it is because if i use setTimeout, it will works fine. but there are no problem in other device when i use nextTick . In the webview 55.0.2883.91. , i can get the right selectionEnd after this line when i debug target.setSelectionRange(selectionEnd, selectionEnd); but the cursor position on the (selectionEnd - 1).

And if i usethe keyup instead of input , the nextTick will not cause problem.

Trendymen commented 5 years ago

It still doesn't reproduce on Chrome 55 nor android 5.1 What is the bug of microtask you are talking about?

I reproduce it on chrome 55.0.2883.91 with android 6.0.1. The key is the Android Chrome version should be 55.0.2883.91.Maybe it doesn't happen on desktop chrome. screenrecorder_Trimmed_20190509_103102 mp4_20190509_105023

Justineo commented 5 years ago

Is this issue only reproducible with custom input methods (Sogou in your case)? I suspect it's related to IME.

Trendymen commented 5 years ago

Is this issue only reproducible with custom input methods (Sogou in your case)? I suspect it's related to IME.

Oh! yes, it happened with Sougou and sony's xperia input method, but Google Gboard works fine.

wLove-c commented 4 years ago

I've had this problem before. I solved that with setTimeout.