- First commit to issue fork.
- @mbm80 opened merge request.
- π¦πΉAustria mbm80
Found a bug where the selected range would be messed up due to the removal of a node within the range.
For example:
<body>[<p></p><span>text</span>]</body> range (container:offset): body:0 body:2 trimElements(firstNode); will then remove <p></p> if this happens after the range sets the end point the end node:offset will stay body:2 although, we only have 1 element now. <body>[<span>text</span>]</body> range (container:offset): body:0 body:2 (should be body:1)
Fixed by moving
trimElements(firstNode);
beforeranges[0].setEndAfter(lastNode)
so that it will have the correct amount of nodes to set the proper offset value.I applied the existing patch & added to commit to the fork MR