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

Description

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
iOS:7.1.1
Environment:Production and Betalabs


Version: unspecified
Severity: normal

Details

Reference
bz66697

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.

[1] https://gerrit.wikimedia.org/r/#/c/155678/
[2] https://gerrit.wikimedia.org/r/#/c/155671/

jgonera wrote:

It's because we call

this.getModel().selectFirstContentOffset();

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

https://gerrit.wikimedia.org/r/155839

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

https://gerrit.wikimedia.org/r/155839

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 (https://bugzilla.wikimedia.org/show_bug.cgi?id=70111) as discussed with Roan.

Verified the fix in production