trix
trix copied to clipboard
Incorrect cursor position after pasting HTML-formatted code from a webpage
When pasting formatted text from the Kubernetes Docs, the cursor gets backed up one character from the end.
Steps to Reproduce
- Go to the Kubernetes Docs
- Copy the formatted yaml from the first example
- Paste into trix editor
- Observe the new cursor position

Details
- Trix version: 0.11.2
- Browser name and version: Google Chrome | 65.0.3325.181 (Official Build) (64-bit)
- Operating system: Linux
A question: after the paste and the resulting incorrect cursor position, if you type 2 or 3 characters from the keyboard (without changing the cursor position), do those characters get inserted correctly (and without corrupting the existing content)?
I found from #494 that an incorrect cursor position is a warning sign that editor is in an incorrect state.
And that if characters are inserted during this state, then the editor will corrupt the existing content.
I tried to reproduce your bug in Windows and Android, but I did not see the buggy behavior so I can't test it on my platforms.
This issue has been automatically marked as stale after 90 days of inactivity. It will be closed if no further activity occurs.
Tried to reproduce the issue with a very minimalistic html as follows
<!DOCTYPE html>
<head>
<link rel="stylesheet" type="text/css" href="./dist/trix.css">
<script type="text/javascript" src="./dist/trix.js"></script>
</head>
<body>
<trix-editor></trix-editor>
</body>
</html>
The above html was placed in root level of trix source code after cloning the repo.
Issue doesnt seem to occur, but the same issue occurs in trix website.
Does the website run the same scripts as present in the dist folder?