Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#8463 closed Bug (fixed)

WebKit: Cut/Copy don't go on "enabled" state

Reported by: Frederico Caldeira Knabben Owned by: Piotrek Koszuliński
Priority: Normal Milestone: CKEditor 3.6.4
Component: UI : Toolbar Version: 3.5.1
Keywords: WebKit Cc: nmaxim@…

Description

Original message from our contact form, Ticket REF : 3815-QDFX-1500.


I found that 'cut' and 'copy' icons do not go to enabled state after you select text in editor (chrome v. 14.0.835.202 m windows). After exploring this I found that there is a problem with queryCommandEnabled function in clipboard plugin, so I propose a solution to you.

function stateFromNamedCommand( command, editor )
{
// IE Bug: queryCommandEnabled('paste') fires also
'beforepaste(copy/cut)',
// guard to distinguish from the ordinary sources( either
// keyboard paste or execCommand ) (#4874).
CKEDITOR.env.ie && ( depressBeforeEvent = 1 );

var retval = CKEDITOR.TRISTATE_OFF;
try {retval = editor.document.$.queryCommandEnabled( command ) ||
CKEDITOR.env.webkit && editor.getSelection().getRanges()[0].startOffset !=
editor.getSelection().getRanges()[0].endOffset ? CKEDITOR.TRISTATE_OFF :
CKEDITOR.TRISTATE_DISABLED;}catch( er ){}

depressBeforeEvent = 0;
return retval;
}

Attachments (1)

8463.patch (2.9 KB) - added by Piotrek Koszuliński 5 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 Changed 6 years ago by Jakub Ś

Status: newconfirmed
Version: 3.5.1

Reproducible from CKEditor 3.5.1 rev [6311]

comment:2 Changed 6 years ago by Piotrek Koszuliński

That bug is visible from rev [6311] because in this revision states of buttons had been bound to what stateFromNamedComand is returning. This function was buggy even before that.

comment:3 Changed 5 years ago by David

Are there any plans to integrate the proposed patch?

comment:4 Changed 5 years ago by Adam

I would also like to see a solution for this issue.

Changed 5 years ago by Piotrek Koszuliński

Attachment: 8463.patch added

comment:5 Changed 5 years ago by Piotrek Koszuliński

Owner: set to Piotrek Koszuliński
Status: confirmedreview

This issue is already fixed in dev version of next major release (inaccessible for you).

I ported correct patch to version 3.6.3 - you can apply it if you want, or wait for new major or bugfixing release.

comment:6 Changed 5 years ago by Piotrek Koszuliński

Version: 3.5.13.6.4 (SVN - trunk)

comment:7 Changed 5 years ago by Adam

@Reinmar, that's awesome. Thank you for this!

comment:8 Changed 5 years ago by Garry Yao

Milestone: CKEditor 3.6.4

comment:9 Changed 5 years ago by Garry Yao

Component: GeneralUI : Toolbar
Keywords: HasPatch removed
Status: reviewreview_passed

comment:10 Changed 5 years ago by Piotrek Koszuliński

Resolution: fixed
Status: review_passedclosed

Fixed with [7504].

comment:11 Changed 5 years ago by Wiktor Walc

Version: 3.6.4 (SVN - trunk)3.5.1

comment:12 Changed 5 years ago by Jakub Ś

#9143 - there is still a problem when you select content with cursor placed underneath this content.

Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy