I’m seeing newlines being inserted when I don’t expect them in the MergeView. This happens in Chrome/Edge, but not Firefox.
You should be able to reproduce the problem with the demo here:
To reproduce:
Method 1 - On the left side of the MergeView delete all the text and then hit the delete key (delete, not backspace) and it’ll insert newlines.
Method 2 - On the left side of the MergeView do select all and then hit any character. It’ll insert the character, but also a newline afterwards.
When I look at the transaction, it has changes with a TextLeaf of text [‘‘, ‘‘] in the first method and [‘(char)’, ‘‘] in the second method. So it’s adding a new line for that.
I did some debugging with the source code and it looks like the problem originates from the DOMChange. The domChange.text will have some weird unprintable character tagged on the end. The charCodeAt for that character is 65535.
The deleteCharFowards command itself behaves correctly and returns false. It’s the DOMChange that adds that the mysterious input.
That’s what I’ve figured out, but I’m not sure what the right fix would be.