Changes between Version 3 and Version 4 of Ticket #13429, comment 5


Ignore:
Timestamp:
Jun 25, 2015, 1:24:14 PM (9 years ago)
Author:
Szymon Cofalik
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #13429, comment 5

    v3 v4  
    55Main idea is, of course, to remember current selection before inserting content and then recreate it. That was easy part.
    66
    7 However, there is a problem when the selection is partially or wholly in the anchor that is being replaced. The best idea I've come up with is to use insertElement instead insertElementIntoRange, which takes care of different cases and sets up caret nicely after paste. We don't change selection after insertHtml.
     7However, there is a problem when the selection is partially or wholly in the anchor that is being replaced. The best idea I've come up with is to use insertElement instead insertElementIntoRange, which takes care of different cases and sets up caret nicely after paste.
    88
    99In alternative solution I don't use insertElement but select pasted content instead. The solution is simpler but it breaks good user experience.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy