Ticket #8463 (closed Bug: fixed)

Opened 2 years ago

Last modified 21 months ago

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

Reported by: fredck Owned by: Reinmar
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

8463.patch (2.9 KB) - added by Reinmar 22 months ago.

Change History

comment:1 Changed 2 years ago by j.swiderski

  • Status changed from new to confirmed
  • Version set to 3.5.1

Reproducible from CKEditor 3.5.1 rev [6311]

comment:2 Changed 2 years ago by Reinmar

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 23 months ago by dbrownITR

Are there any plans to integrate the proposed patch?

comment:4 Changed 22 months ago by astjohn

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

Changed 22 months ago by Reinmar

comment:5 Changed 22 months ago by Reinmar

  • Owner set to Reinmar
  • Status changed from confirmed to review

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 22 months ago by Reinmar

  • Version changed from 3.5.1 to 3.6.4 (SVN - trunk)

comment:7 Changed 22 months ago by astjohn

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

comment:8 Changed 22 months ago by garry.yao

  • Milestone set to CKEditor 3.6.4

comment:9 Changed 22 months ago by garry.yao

  • Keywords HasPatch removed
  • Status changed from review to review_passed
  • Component changed from General to UI : Toolbar

comment:10 Changed 22 months ago by Reinmar

  • Status changed from review_passed to closed
  • Resolution set to fixed

Fixed with [7504].

comment:11 Changed 21 months ago by wwalc

  • Version changed from 3.6.4 (SVN - trunk) to 3.5.1

comment:12 Changed 21 months ago by j.swiderski

#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 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy