Page MenuHomePhabricator

Shift-Delete keyboard "cut" shortcut doesn't work
Closed, ResolvedPublic1 Estimated Story Points

Description

Expected: it should cut the text.
Current behaviour: current selection is simply deleted.
Opera 11.60.

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:58 PM
bzimport set Reference to bz33080.

Why is this the expected behavior? It seems like someone could reasonably expect simple deletion.

All the browsers on Windows I've seen treat this combination as "Cut" for input fields. Would be strange if it worked the other way in visual editor.

Ah, ff on linux, too. I just hadn't tried it before.

To confirm, should this "cut the text and enter into the clipboard" or just delete it? If the latter, FIXED. If the former, will need to assign.

(In reply to comment #4)

To confirm, should this "cut the text and enter into the clipboard" or just
delete it? If the latter, FIXED. If the former, will need to assign.

Cut, not delete.

orbit wrote:

Unfortunately, due to the way that we're handling copy and paste, we're not going to be able to support this key combination at this time. Because we don't want the browser to make decisions about removing content from the article (our data model makes those decisions), we need to prevent native delete events. The problem with Shift-Delete is that the browser first fires a delete event (which we block), followed by a cut event, which we rely on the browser to handle natively.

The key here is "at this time": while currently it's not planned, it's natural for people to want all the keyboard shortcuts they're used to to work. Thus I'm reopening this bug in a bit generalised form.

orbit wrote:

Added "Shift-Delete" back into the title. Please leave it there as it's the only mention of the particular keyboard shortcut. Thanks! :)

Mass-moving items into VisualEditor product

Mass-move out of "General" to "ContentEditable".

Also note that this appears to be platform specific. In that we shouldn't emulate it either because in Mac for instance there is no such thing as shift-delete. It is the same as regular delete (the shift doesn't do anything, and depending on the application it might even prevent the regular deletion because it doesn't recognise the keyboard combination).

As pointed out, shift-delete on the Mac does NOT behave the same as in Windows - shift-delete is identical to delete. (Test: Microsoft Word on the Mac.) Also, shift-delete in some contexts is a super-delete (see support.microsoft.com/kb/239754 )

Given that shift-delete is OS-specific, not universal, and that Ctrl-X (Cmd-X on Macs) is the normal way to cut text (to the clipboard), and works perfectly fine in VE, I recommend closing this bug rather than trying to implement the suggested behavior.

As pointed out, shift-delete on the Mac does NOT behave the same as in Windows - shift-delete is identical to delete

That's covered in T57799: VisualEditor: Support the Command+Delete keyboard command on Mac (delete current line) and others (cross-referencing).

Jdforrester-WMF lowered the priority of this task from Medium to Lowest.Feb 12 2015, 1:04 AM
Jdforrester-WMF renamed this task from VisualEditor: Shift-Delete keyboard "cut" shortcut doesn't work to Shift-Delete keyboard "cut" shortcut doesn't work.Sep 8 2015, 3:09 PM
Jdforrester-WMF updated the task description. (Show Details)
Jdforrester-WMF set Security to None.

Change 236796 had a related patch set uploaded (by Esanders):
Allow shift delete to cut on non-Mac platforms

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

Change 236796 merged by jenkins-bot:
Allow shift delete to cut on non-Mac platforms

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

Jdforrester-WMF assigned this task to Esanders.
Jdforrester-WMF edited a custom field.