Changes between Version 4 and Version 5 of Ticket #13429, comment 5
- Timestamp:
- Jun 25, 2015, 1:25:06 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #13429, comment 5
v4 v5 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.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 In alternative solution I don't use insertElementbut select pasted content instead. The solution is simpler but it breaks good user experience.9 In alternative solution I don't use `insertElement()` but select pasted content instead. The solution is simpler but it breaks good user experience. 10 10 11 11 Note: 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.