Page MenuHomePhabricator

Opening special character toolbar moves the cursor to [1,1]
Closed, ResolvedPublic

Description

  1. Place your cursor in the middle of the page
  2. Open the special character toolbar
  3. Observer your cursor jumps to the start of the document

Expected:

  1. Cursor stays where it was, and you can continue typing

Event Timeline

This comment was removed by Esanders.

The bug occurs with the special character toolbar because it tries to focus the surface in ve.ui.SpecialCharacterDialog.prototype.getReadyProcess(), which is necessary because OO.ui.Window.prototype.ready() focusses the window itself.

I don't understand why this conflicts with the changes from 651722, but the issue disappears if I comment out either the line this.$content.trigger( 'focus' ); in ready(), or this.surface.getView().focus(); in getReadyProcess().

Change 667853 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[VisualEditor/VisualEditor@master] ve.ui.SpecialCharacterDialog: Keep selection when opening the dialog

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

Change 667854 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[VisualEditor/VisualEditor@master] Only apply toolbar focus hack to surfaces that clear selection on blur

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

That fixes it, but I still don't really understand why the issue happens. I've already spent nearly two days on this, and there ar probably other things I should be working on.

Change 667853 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] ve.ui.SpecialCharacterDialog: Keep selection when opening the dialog

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

Change 667854 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Only apply toolbar focus hack to surfaces that clear selection on blur

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

Change 669997 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (6c46defab)

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

Change 669997 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (6c46defab)

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

matmarex edited projects, added Editing QA; removed Patch-For-Review.
matmarex moved this task from Code Review to QA on the Editing-team (Kanban Board) board.
matmarex updated the task description. (Show Details)
matmarex added a subscriber: dchan.
  NODES
Note 3
Project 7