Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#12255 closed Bug (fixed)

Anchor dialog does not display existing anchor name when dialog was opened by doubleclick

Reported by: Henning Owned by:
Priority: Normal Milestone:
Component: General Version: 3.6.6
Keywords: Cc:

Description

  1. In CKEditor 4.3.5 and Chrome
  2. edit a new text
  3. enter the following in source mode
  4. <a id="anchorId" name="anchorName">anchorText</a>
  5. switch to wysiwyg mode
  6. doubleclick on anchorText
  7. in the anchor dialog, the anchor name is not displayed.

If you just click into the text "anchorText" and open the anchor dialog via the toolbar, the anchor name is displayed in the dialog.

Debugging the code in link plugin's anchor.js, I found that the method tryRestoreFakeAnchor did not detect a fake anchor, but was trusted nevertheless such that the existing real anchor was not used. Only if the element was "fullySelected". The following code change resolved the issue:

Existing code:

if ( CKEDITOR.plugins.otmslink.fakeAnchor ) {
	var realElement = CKEDITOR.plugins.otmslink.tryRestoreFakeAnchor( editor, fullySelected );
	realElement && loadElements.call( this, realElement );
	this._.selectedElement = fullySelected;
} else if ( fullySelected.is( 'a' ) && fullySelected.hasAttribute( 'name' ) )

Changed code

var realElement;
if ( CKEDITOR.plugins.otmslink.fakeAnchor ) {
    realElement = CKEDITOR.plugins.otmslink.tryRestoreFakeAnchor( editor, fullySelected );
    realElement && loadElements.call( this, realElement );
    this._.selectedElement = fullySelected;
}
if (!realElement && fullySelected.is('a') && fullySelected.hasAttribute('name')) {
    loadElements.call(this, fullySelected);
}

Change History (3)

comment:1 Changed 10 years ago by Alan

Keywords: HasPatch added; anchor removed
Status: newconfirmed
Version: 4.3.53.6.6

comment:2 Changed 10 years ago by Jakub Ś

Keywords: HasPatch removed
Resolution: fixed
Status: confirmedclosed

I'm unable to reproduce this problem in latest CKEditor 4.4.3. In fact I'm not able to reproduce it starting from version 4.4.

This issue seems to be fixed.

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

We changed a lot in 4.4 for anchors, so it's very likely that we fixed this.

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