miztroh-zz / wysiwyg-e

A what-you-see-is-what-you-get editor created with Polymer
85 stars 18 forks source link

Clicking on a tool icon moves the cursor #196

Closed lastmjs closed 6 years ago

lastmjs commented 7 years ago

Whenever I click on a tool icon, the cursor jumps to the end of the first line.

Example text:

Hello there

The first line says Hello there. I then hit enter twice and place the cursor at the beginning of the third line. When I click one of the tools, the cursor will jump back to the end of the first line. I believe this is the cause of issues I'm having with range0 not being set correctly when I am on empty lines.

lastmjs commented 6 years ago

I'm getting some other erratic behavior besides the case I described above. If the first line is empty, and lines below it have content, and then I click on a tool, the cursor jumps to the beginning of the line below it.

lastmjs commented 6 years ago

If I get some input on this, I can try my hand at fixing this.

miztroh-zz commented 6 years ago

Issue confirmed and is caused in the following section of code. I'll take a look at resolving this as soon as I can.

https://github.com/miztroh/wysiwyg-e/blob/master/wysiwyg-e.html#L1271-L1280

miztroh-zz commented 6 years ago

@lastmjs Check out the above commit to the master branch and let me know if it resolves this issue for you.

lastmjs commented 6 years ago

Great, I really appreciate it. I'll get to all of these when I can, I've been occupied with some other tasks

miztroh-zz commented 6 years ago

@lastmjs I went ahead and created a new release including several recent bug fixes. You can just grab the latest release instead of the master branch.

https://github.com/miztroh/wysiwyg-e/releases/tag/v2.0.6

lastmjs commented 6 years ago

The issue seems to be resolved, thanks!