Page MenuHomePhabricator

VisualEditor Mobile: Cursor jumps to the beginning of the article, irrespective of the position user trying to tap and put the cursor into
Closed, ResolvedPublic


Steps to reproduce:

1.Open a page with Mobile VE
2.Tap somewhere in the middle of the article
3.Insert some text
4.Close the keypad
5.Now again tap at the end of the text that you typed in

Observed Result:
The cursor moves to the beginning of the article, not where the user wanted to start his edit.

Device: iPad Mini
Environment:Production and Betalabs

Version: unspecified
Severity: normal



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:16 AM
bzimport set Reference to bz66697.

Might be related to the context being wrong in iOS?

jgonera wrote:

Might be related to bug 68832.

jgonera wrote:

Trying to figure this one out now.

If you set hasFocus to false in ve.ce.Surface#onFocusChange, the problem goes away.

If you already have the fix for bug 68832 [1][2], then this is easier to reproduce because it happens on every tap on the CE.


jgonera wrote:

It's because we call


in ve.ce.Surface#onDocumentFocus as a workaround for Firefox. I guess we'd want this.dragging to be true when someone taps on a touch device, but it's false instead.

jgonera wrote:

this.dragging is false because onFocusChange is called after onDocumentMouseUp.

The order of events on iOS Safari seems to be fine though:

  • mousedown
  • focus
  • mouseup

Change 155839 had a related patch set uploaded by JGonera:
Check for selection in ve.ce.Surface#onDocumentFocus

Change 155839 merged by jenkins-bot:
Check for selection in ve.ce.Surface#onDocumentFocus

The original issue that cursor jumps to the beginning of the article is resolved, but still remains issue where the page is not actually getting scrolled down to the point where the cursor is currently positioned at.I have filed a different bug on that ( as discussed with Roan.

Verified the fix in production