Last modified: 2013-08-25 14:15:33 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 T41649, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 39649 - CodeEditor extension's tab key behavior is slightly infuriating
CodeEditor extension's tab key behavior is slightly infuriating
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
CodeEditor (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-25 17:43 UTC by MZMcBride
Modified: 2013-08-25 14:15 UTC (History)
10 users (show)

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


Attachments

Description MZMcBride 2012-08-25 17:43:16 UTC
For years, I've used the tab key on my keyboard to switch between the textarea and the edit summary input on MediaWiki wikis. Then I usually press the tab key a few more times to select the "save page" or "show preview" buttons.

When CodeEditor is active, the tab key is hijacked, inserting four spaces into the textarea when the tab key is pressed. This is a legitimate hijacking, I think, but it disrupts the (somewhat expected) tab key behavior in a slightly infuriating way.

There's no way to escape the textarea short of using the mouse. This sucks.

I'm not sure how to best handle this. Maybe a double-tap of the tab key could be used? Maybe the escape key could be used? Shift-tab (which may already be taken)?
Comment 1 Brion Vibber 2012-08-25 20:28:13 UTC
The tricky thing here of course is that the tab key is expected to do something specific in a code editor, which is to indent (either with literal tabs or spaces).

Double-tap of tab would not work well, as that would behave unexpectedly when hitting tab twice to indent text two levels.

Shift-tab is taken for de-indent, as expected in most code editors.

Unfortunately I'm not sure what a good solution for this is other than "use the mouse" or "use another key combination to jump to another part of the page". :(
Comment 2 MZMcBride 2012-08-25 22:08:24 UTC
(In reply to comment #1)
> Unfortunately I'm not sure what a good solution for this is other than "use the
> mouse" or "use another key combination to jump to another part of the page". :(

Yeah, it's a nasty usability problem.

Some part of me thinks the escape key isn't too crazy for this. Escaping the textarea --> press the escape key. In this scenario, hitting the escape key would jump the (cursor) focus to the edit summary input field and then from there you can tab to the other page elements such as "save page". Though this would open the door to people requesting that the same functionality exist without CodeEditor and/or questioning why the escape key doesn't attempt to (more obviously) escape/cancel the edit instead.
Comment 3 Brion Vibber 2012-08-25 22:53:28 UTC
I like it (esc) -- at least to take the focus out of the textarea so it can be used elsewhere. Strikes me as a nice idea. :)
Comment 4 MZMcBride 2012-08-26 05:09:27 UTC
(In reply to comment #3)
> I like it (esc) -- at least to take the focus out of the textarea so it can be
> used elsewhere. Strikes me as a nice idea. :)

My only qualm is discoverability: will it be obvious to anyone that this is the workaround? On the other hand, CodeEditor is mostly aimed at nerds, so I'm not sure how discoverable a trick this needs to be.

Copying Brandon, Trevor, Roan, Ryan, and Krinkle on the bug, in case they have any insights into this. I considered a wikitech-l thread, but I'm not sure the world needs another wikitech-l thread from me this month.
Comment 5 Krinkle 2012-08-26 16:59:36 UTC
I believe in the scope of a code editor (not on the web in general) it is more likely that the user is looking (and expecting) to indent code with Tab, than to transfer the browser focus to the focusable element.

Given that CodeEditor context, I think Esc is just fine without additional discoverability requirements.

I mean, it is more important that we can use tab to indent then to use tab to transfer focus. Having to use Esc is not ideal, but I think it's worth the trade of given these choices (if anyone has another idea, that's always welcome of course).
Comment 6 MZMcBride 2012-08-26 18:45:25 UTC
All right. Well, having the escape key change focus to the edit summary input should be like three lines of code, so I'll mark this as easy.
Comment 7 Nemo 2013-01-11 18:51:25 UTC
-easy: the summary doesn't even say what to do exactly.
Comment 8 MZMcBride 2013-01-12 05:07:28 UTC
(In reply to comment #7)
> -easy: the summary doesn't even say what to do exactly.

Read comment 6.

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


Navigation
Links