- Place your cursor in the middle of the page
- Open the special character toolbar
- Observer your cursor jumps to the start of the document
Expected:
- Cursor stays where it was, and you can continue typing
Expected:
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
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
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.
Test wiki created on Patch Demo by JKlein (WMF) using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/d097865dbe44111d99feb62a8237c1a7/w/
Change 667853 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] ve.ui.SpecialCharacterDialog: Keep selection when opening the dialog
Change 667854 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Only apply toolbar focus hack to surfaces that clear selection on blur
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)
Change 669997 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (6c46defab)
Test wiki on Patch Demo by JKlein (WMF) using patch(es) linked to this task was deleted:
https://patchdemo.wmflabs.org/wikis/d097865dbe44111d99feb62a8237c1a7/w/