Changes between Version 3 and Version 4 of Ticket #13429, comment 5
- Timestamp:
- Jun 25, 2015, 1:24:14 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #13429, comment 5
v3 v4 5 5 Main idea is, of course, to remember current selection before inserting content and then recreate it. That was easy part. 6 6 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.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. 8 8 9 9 In alternative solution I don't use insertElement but select pasted content instead. The solution is simpler but it breaks good user experience.