Opened 9 years ago

Last modified 9 years ago

#7842 confirmed Bug

Selection handles in FF can't be set or removed

Reported by: daveVW Owned by:
Priority: Normal Milestone:
Component: General Version: 3.0
Keywords: Firefox Cc:

Description

If you click (select) an image, table, anchor, ... in FF then the selection handles appear. Now try to reset the selection using javascript code :

oEditor.getSelection().reset();

OR

var doc = oEditor.document; var range = new CKEDITOR.dom.range(doc); var body = doc.getBody(); range.setStart(body, 0); range.setEnd(body, 0); oEditor.getSelection().selectRanges( [range] );

The selection is removed (this can be checked with selection.getSelectedElement), but the selection handles in the wysiwyg area remain.

Also, when trying to select an element using javascript code (oEditor.getSelection.selectElement()), the selection handles do not appear.

I think this is a bug in CKEditor and not in FF because it did work in the previous version FCKEditor.

Change History (1)

comment:1 Changed 9 years ago by Jakub Ś

Keywords: Firefox added
Status: newconfirmed
Version: 3.5.33.0

In the replacebycode sample I have added two buttons

<input type="button" value="If" onclick="a(1);" />
<input type="button" value="Else" onclick="a(2);" />

and a JS function in head section:

<script type="text/javascript">
		function a(flag){
			alert(CKEDITOR.instances['editor1'].getSelection().getSelectedElement());
			if(flag == '1'){
				CKEDITOR.instances['editor1'].getSelection().reset();
			}else{
				var doc = CKEDITOR.instances['editor1'].document;
				 var range = new CKEDITOR.dom.range(doc); 
				 var body = doc.getBody(); 
				 range.setStart(body, 0); 
				 range.setEnd(body, 0); 
				 CKEDITOR.instances['editor1'].getSelection().selectRanges( [range] ); 
			}
			alert(CKEDITOR.instances['editor1'].getSelection().getSelectedElement());			
		}
</script>

The first if doesn't seem to work at all.
The second works fine except in FF. It removes the selection but this removal is not visible in wysiwyg mode.

This issue has occured in FF browsers from CKEditor 3.0.

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