Opened 9 years ago

Closed 9 years ago

#12140 closed defect (fixed)

cannot always cut selected text with the mouse

Reported by: Douglas Hays Owned by: Douglas Hays
Priority: high Milestone: 1.6
Component: Editor Version: 1.5
Keywords: Cc: Jared Jurkiewicz
Blocked By: Blocking:

Description

Run test_Editor.html with any browser (I'm testing with IE6).
In the 2nd Editor, delete all the text and type MMMM
Select all the text by dragging across it with the mouse but make sure to release the mouse button outside the Editor frame.
Now press the Cut icon and nothing happens even though text is selected. The problem is that onclick does not fire when the mouse is released outside the content area. onmouseup should have been used instead.

Attachments (1)

12140.patch (8.3 KB) - added by Douglas Hays 9 years ago.
patch to enable Cut/Copy? onmouseup instead of onclick, and for WebKit?, whenever a selection is made

Download all attachments as: .zip

Change History (8)

comment:1 Changed 9 years ago by Jared Jurkiewicz

I think that's okay? Not 100% sure, though.

comment:2 Changed 9 years ago by Douglas Hays

I cannot get cut or copy to work in WebKit? at all from the toolbar. Is this new news?

comment:3 Changed 9 years ago by bill

That looks like a bug to me, it should probably be popping up an alert() like firefox does, telling people to use ctrl-X. It pops up the alert for pasting.

comment:4 Changed 9 years ago by Douglas Hays

The cut icon is disabled on webkit since queryCommandEnabled('cut') is returning false whereas it returns true on mozilla. Seems to be a clipboard/security change in the Chrome 6 timeframe and we don't have any clipboard tests that would have noticed.

comment:5 Changed 9 years ago by bill

Hmm, I don't understand why mozilla returns true, given that it doesn't actually allow executing the command (hence the alert dialog popping up).

To be as consistent as possible across browsers, seems like the icons should always be enabled (except perhaps when there's an empty selection), and then pressing them should popup the alert.

Changed 9 years ago by Douglas Hays

Attachment: 12140.patch added

patch to enable Cut/Copy? onmouseup instead of onclick, and for WebKit?, whenever a selection is made

comment:6 Changed 9 years ago by Douglas Hays

Changed patch per Bill's suggestion to check the selection on WebKit?. Added an automated test. Verified Cut still works properly on Safari 4, but on Safari 5 it generates the alert that says to use the keyboard (which is hard to test btw, maybe a tooltip would be less intrusive).

comment:7 Changed 9 years ago by Douglas Hays

Resolution: fixed
Status: newclosed

(In [23511]) Fixes #12140. Workaround a WebKit? (Safari 5/Chrome 6)change where programmatic clipboard ops are disallowed for security reasons. !strict

Note: See TracTickets for help on using tickets.