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


Ignore:
Timestamp:
Jun 25, 2015, 1:25:06 PM (5 years ago)
Author:
Szymon Cofalik
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #13429, comment 5

    v4 v5  
    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.
     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
    9 In alternative solution I don't use insertElement but select pasted content instead. The solution is simpler but it breaks good user experience.
     9In alternative solution I don't use `insertElement()` but select pasted content instead. The solution is simpler but it breaks good user experience.
    1010
    1111Note: I didn't use bookmarks because we don't need them: if selection is valid we can use range and if it is invalid we wouldn't use them anyway and they caused problems with snapshots.
© 2003 – 2020 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy