Last modified: 2014-08-13 23:40:55 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T52868, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 50868 - VisualEditor: Escape key (and on Macs additionally ⌘-. ) inside the main editor should cancel VE mode and return to action=view
VisualEditor: Escape key (and on Macs additionally ⌘-. ) inside the main edit...
Status: ASSIGNED
Product: VisualEditor
Classification: Unclassified
Editing Tools (Other open bugs)
unspecified
All All
: Low enhancement
: ---
Assigned To: Editing team bugs – take if you're interested!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-06 17:41 UTC by Jason Giglio
Modified: 2014-08-13 23:40 UTC (History)
10 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Jason Giglio 2013-07-06 17:41:52 UTC
I see that a cancel button has been added, which is an improvement, but the escape key should also cancel edit mode.
Comment 1 Bartosz Dziewoński 2013-07-06 17:49:20 UTC
The escape key is used by browsers to defocus (blur) currently focused form element. Reusing it for this would be really annoying.
Comment 2 Jason Giglio 2013-07-06 18:41:54 UTC
What browsers?  Not Chrome or Firefox.  I don't have IE here to test with, but I doubt it does it either.

http://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_event_blur_alert
Comment 3 Bartosz Dziewoński 2013-07-06 19:37:25 UTC
Opera does that; it's useful enough that I expected other browsers to behave similarly. IE8 resets the value to the default (for both inputs and textareas). And Firefox apparently doesn't do anything, like you said.
Comment 4 Jason Giglio 2013-07-06 20:41:49 UTC
OK, but my next question is: What form fields are people going to be interacting with when in the main Visualeditor?  The only form field I see is the search box.
Comment 5 James Forrester 2013-07-06 21:12:36 UTC
I think this isn't a bad idea, though I'm a little troubled if this causes unexpected behaviour for users of some browsers.
Comment 6 Derk-Jan Hartman 2013-07-07 20:25:12 UTC
On macs, cancel is usually cmd-.

Wouldn't mind having that in VE.
Comment 7 Oliver Keyes 2013-07-09 09:13:07 UTC
I'd like to note that really this should only happen iff someone is exclusively in edit mode. IOW, if someone has opened the template inspector, close that. Link inspector, close that - so on and so forth.
Comment 8 Jason Giglio 2013-07-09 15:04:15 UTC
Agreed, that's how I envisioned it.
Comment 9 James Forrester 2013-07-09 18:28:17 UTC
Clarify title so it's clear we all agree.
Comment 10 Chris McKenna 2013-07-17 02:20:50 UTC
Yes, pressing escape when in a dialog should close that level of the dialog (if more than one) or the dialog if it's at the top level of the dialog. If a change was confirmed then it should remain when closed, if a change was unconfirmed it should be cancelled. 

With no dialogs open, escape should exit VE but should ask for confirmation before doing so if there are unsaved changes. That dialog should have keyboard actions such that enter confirms you want to leave and escape indicates that you don't want to leave and take you back to the VE. This will stop people losing work if they hit esc accidentally or too many times.
Comment 11 WhatamIdoing 2014-08-13 23:35:09 UTC
I'm a bit worried about this.  What if I'm in a template dialog and accidentally press Esc twice/too long?  If this triggered the "Do you really wnt to exit?" confirmation, it might be okay.  However, I suspect that this might not have the ultimate effect that was intended.
Comment 12 Roan Kattouw 2014-08-13 23:40:55 UTC
(In reply to WhatamIdoing from comment #11)
> I'm a bit worried about this.  What if I'm in a template dialog and
> accidentally press Esc twice/too long?  If this triggered the "Do you really
> wnt to exit?" confirmation, it might be okay.  However, I suspect that this
> might not have the ultimate effect that was intended.

Comment 10 asks for the unsaved changes warning to be shown. If we do that, I think it'll be fine. Pressing escape while a dialog is open will dismiss that dialog with a safe action (the cancel/never mind action). So if you press escape again when the unsaved changes warning is visible, that'll dismiss the warning with the safe action, which is "never mind, I want to continue editing". So if you press Esc a bunch of times or hold it too long, you'll end up in a loop of the unsaved changes warning appearing and being dismissed.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links