Opened 9 years ago

Closed 9 years ago

#14266 closed Bug (invalid)

Click events lost

Reported by: Dhana Owned by:
Priority: Normal Milestone:
Component: General Version: 4.5.4
Keywords: Cc:

Description

Steps to reproduce

  1. editor.insertHtml is used in my code to insert span element with onclick attribute there.
  2. Switch to 'Source' in toolbar, click on it again to see the editor area
  3. Now we have lost the click event, clicking span element no longer triggers click event.

Expected result

Actual result

Other details (browser, OS, CKEditor version, installed plugins)

Change History (2)

comment:1 Changed 9 years ago by Dhana

Also, when I saved the ckeditor content, reload the page, all the click events are lost.

comment:2 Changed 9 years ago by Jakub Ś

Resolution: invalid
Status: newclosed

You need to learn about ACF:
http://docs.ckeditor.com/#!/guide/dev_acf
http://docs.ckeditor.com/#!/guide/dev_advanced_content_filter
http://docs.ckeditor.com/#!/guide/dev_disallowed_content
http://docs.ckeditor.com/#!/api/CKEDITOR.filter-method-addTransformations
http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-allowedContent
http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-extraAllowedContent
http://nightly.ckeditor.com/14-03-20-07-05/full/samples/datafiltering.html

This configuration prevents removing onclick handler:

var editor = CKEDITOR.replace( 'editor1', {
	extraAllowedContent : '*[onclick]'
});

Please also note that onclick will not work in design mode (for security reasons). You need to preview the page in order to see result.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy