Page MenuHomePhabricator

Mobile: Hide keyboard while menus are open
Closed, ResolvedPublic

Description

The user shouldn't need to type while the menus are being used, and the virtual keyboard drastically reduces the amount of space available to show the menus.

It should be possible to use surfaceView.deactivate() to achieve this.

Event Timeline

Change 450612 had a related patch set uploaded (by Esanders; owner: Esanders):
[oojs/ui@master] Toolbar: Emit events to let user know if toolbar popups are visible

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

Change 450616 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] Mobile: Deactivate the surface when the toolbar is active

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

If we are confident there are no real downsides to this approach, we could actually upstream it to ve.init.Target and do it for every VE instance, desktop and mobile. This would:

  • avoid any issues when using a desktop version on a mobile device (e.g. on a large tablet)
  • allow users to put focusable widgets inside toolbars without losing document position
  • allow users to use toolbar keyboard accessibility without losing document position

CCing @matmarex @DLynch

I think that sounds like a good idea. I can't think of any downsides (but that doesn't mean there are none…). Should I be reviewing the current patches, or do you want to rewrite with this approach?

Review the OOUI patch. I'll probably replace the ve-mw patch with a core one.

Change 450612 merged by jenkins-bot:
[oojs/ui@master] Toolbar: Emit events to let user know if toolbar popups are visible

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

Change 452725 had a related patch set uploaded (by Esanders; owner: Esanders):
[VisualEditor/VisualEditor@master] Deactivate the surface when the toolbar is active

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

Change 450616 abandoned by Esanders:
Mobile: Deactivate the surface when the toolbar is active

Reason:
upstreamed to https://gerrit.wikimedia.org/r/#/c/VisualEditor/VisualEditor/ /452725/

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

Change 452872 had a related patch set uploaded (by VolkerE; owner: VolkerE):
[mediawiki/core@master] Update OOUI to v0.28.0

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

Change 452872 merged by jenkins-bot:
[mediawiki/core@master] Update OOUI to v0.28.0

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

Change 452725 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Deactivate the surface when the toolbar is active

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

Change 453292 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (aac36db2c)

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

Deskana triaged this task as Medium priority.Aug 17 2018, 9:29 AM

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

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

(Copying from code review comment so it doesn't get lost)

If I have the document focussed, then click "Insert" to open the menu, then click "Insert" again to close it, I expect to have a cursor in the editing surface again. But it doesn't get focussed; I can't type until I click on it. Same problem if I click "Insert" → "Table", then Ctrl+Z to undo – I can't type until I click on the surface.

Change 453430 had a related patch set uploaded (by Esanders; owner: Esanders):
[VisualEditor/VisualEditor@master] Reactive surface on toolbar close

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

Thanks @matmarex, I initially though this wasn't necessary, but your use case makes sense. The above patch fixes this

Ah, I remembered why I did it that way, it's because on mobile I though it would be nicer not to bring up the keyboard (which is triggered by focus) as soon as your are finished with the toolbar. That may yet prove to be the case, but any such fix for that should be in mobile-specific targets.

Change 453430 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Reactivate surface on toolbar close

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

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

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

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

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

Change 454013 had a related patch set uploaded (by Esanders; owner: Esanders):
[VisualEditor/VisualEditor@master] Blur activateElement when deactivating the surface

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

The above patch fixes the issue on iOS (which also requires activeElement be blurred).

Change 454013 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Blur activateElement when deactivating the surface

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

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

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

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

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

This might not be relevant to this task, but can we also reactivate the surface when we close a dialog without adding anything, like pressing back on link inspector dialog/Citation dialog?

Moving it to "Done" Column, But @Deskana/ @Esanders let me know if I should file a separate task for the above case.

Moving it to "Done" Column, But @Deskana/ @Esanders let me know if I should file a separate task for the above case.

Yeah, can you file a separate task for that? Thanks!

Moving it to "Done" Column, But @Deskana/ @Esanders let me know if I should file a separate task for the above case.

Yeah, can you file a separate task for that? Thanks!

Done - T203517