Opened 15 years ago

Last modified 14 years ago

#3133 review_failed Bug

insertElement incorrect after deleteContents

Reported by: Garry Yao Owned by: Garry Yao
Priority: Normal Milestone:
Component: General Version: 3.0 Beta 2
Keywords: Confirmed Cc:

Description (last modified by Garry Yao)

If there's a insertion happened after the selection range content is deleted, the inserted element is at the end instead of in the front.
Take the smiley plugin for reproducing:

  1. Make the content and selection as below:
    		<p>te^xt</p>
    		<ul>
    			<li>te^xt</li>
    		</ul>
    
    
  2. Open the smiley plugin to insert a motion;
  • Expected Result:
    <p>te<img alt=":)" title=":)" ...></p><ul><li>xt</li></ul>
    
  • Actual Result:
    <p>te</p><img alt=":)" title=":)" ...><ul><li>xt</li></ul>
    

Attachments (3)

3133.patch (585 bytes) - added by Garry Yao 15 years ago.
3313_2.patch (2.8 KB) - added by Garry Yao 15 years ago.
3133_3.patch (3.9 KB) - added by Garry Yao 14 years ago.

Download all attachments as: .zip

Change History (20)

comment:1 Changed 15 years ago by Frederico Caldeira Knabben

I think you have inverted the "expected" and "actual" results, right?

comment:2 Changed 15 years ago by Garry Yao

Description: modified (diff)
Keywords: Confirmed added

Updated the bug symptom with current trunk.

comment:3 Changed 15 years ago by Frederico Caldeira Knabben

Please do not change the ticket description in this way. If anything changed, you can add comments for it.

In this specific case for example, your original ticket text was much more useful to understand the bug (the js error is just another issue here).

comment:4 in reply to:  3 Changed 15 years ago by Garry Yao

Description: modified (diff)

Replying to fredck:

Please do not change the ticket description in this way. If anything changed, you can add comments for it.

In this specific case for example, your original ticket text was much more useful to understand the bug (the js error is just another issue here).

Revert to the old description.

Changed 15 years ago by Garry Yao

Attachment: 3133.patch added

comment:5 Changed 15 years ago by Garry Yao

Keywords: Review? added
Owner: set to Garry Yao
Status: newassigned

The proposed path will insert those inline elements at the original editable end after deletion instead of the collapsed position.

Changed 15 years ago by Garry Yao

Attachment: 3313_2.patch added

comment:6 Changed 15 years ago by Garry Yao

The correct carot position should be at the original editable start instead.

comment:7 Changed 15 years ago by Garry Yao

The below line might be confusing since it's relay on the buggy 'getBoundaryNodes', which report the result nodes up-side-down on collapsed range(#3292).

comment:8 in reply to:  7 Changed 15 years ago by Garry Yao

Replying to garry.yao:

// Place the editing carot after the editing end of previous node.
range.moveToElementEditEnd( range.getBoundaryNodes().endNode );

comment:9 Changed 15 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.0CKEditor 3.1

comment:10 Changed 15 years ago by Alfonso Martínez de Lizarrondo

Version: SVN (FCKeditor)CKEditor 3.0 Beta 2

comment:11 Changed 15 years ago by Tobiasz Cudnik

Please refresh patch to newest trunk, as there are conflicts right now. Also, the patch filename contains wrong ticket number.

comment:12 Changed 14 years ago by Garry Yao

Keywords: Review- added; Review? removed

Changed 14 years ago by Garry Yao

Attachment: 3133_3.patch added

comment:13 Changed 14 years ago by Garry Yao

Keywords: Review? added; Review- removed

Ticket Test added at :
http://ckeditor.t/tt/3313/1.html.

comment:14 Changed 14 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.1CKEditor 3.2

comment:15 Changed 14 years ago by Garry Yao

Ticket Test updated at : http://ckeditor.t/tt/3133/1.html[[BR]]

comment:16 Changed 14 years ago by Frederico Caldeira Knabben

Keywords: Review- added; Review? removed
Milestone: CKEditor 3.2CKEditor 3.x

This patch needs updates again, as it's not anymore "applyable" into trunk.

comment:17 Changed 14 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.x

Milestone CKEditor 3.x deleted

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