Page MenuHomePhabricator

Keyboard shortcuts on history page no longer work in 1.18
Closed, ResolvedPublic

Description

Before the "Compare these two versions" button was replaced via JavaScript with a link there were two keyboard shortcuts, which now no longer work:

  • Pressing [Alt] + [Shift] (browser dependend) + [v]
  • Pressing Enter

Both used to submit the form and so compare the two selected versions.
While the first just doesn't work, pressing enter sometimes now triggers revisiondelete unwantedly.


Version: 1.18.x
Severity: normal

Details

Reference
bz28945

Event Timeline

bzimport raised the priority of this task from to High.Nov 21 2014, 11:29 PM
bzimport set Reference to bz28945.

This'll be from the recent code to replace the buttons with clickable links, and I don't believe it's in 1.17.

The JS code that replaces the button probably needs to copy the accesskey from the button to the link.

This fixes the accesskey issue but not the problem with enter key.

After some test I must be a bit more precise:
Submitting the form on enter key is a Firefox/Internet Explorer specific behavior, Opera and Konqueror do nothing when the radio buttons have the focus and you press enter. Adding an explicit event handler for keydown (or keypress or keyup) for the radio buttons should solve this.

Submitting the form on enter key is a Firefox/Internet Explorer
specific behavior, Opera and Konqueror do nothing when the radio
buttons have the focus and you press enter. Adding an explicit event
handler for keydown (or keypress or keyup) for the radio buttons
should solve this.

This is an upstream bug or feature then, right?

Sounds like that bit is WONTFIX or, more precisely, outside the scope
of something MW should fix. People hate it when you change the
behavior of their browser.

Can I just ask what the point is in replacing a button with a javascript button, if it breaks the earlier form behavior ?

(In reply to comment #5)

People hate it when you change the
behavior of their browser.

Replacing the submit button with a link does change the behavior for most (= all Firefox and Internet Explorer) users. One can't really expect a browser to detect that pressing the enter key should be treated as a click on the link the submit button was replaced with, so it's not an upstream bug.

On the other hand adding an event handler for the enter key being pressed while the radio buttons have the focus fixes the issue for Firefox and IE without doing harm to other browsers, since Opera just doesn't do anything by default when you press the enter key while the focus is on radio buttons. So a user of Opera who knows what his browser behaves like won't notice the change (because he doesn't press the enter key) and thus can't hate the change.