chmln / vue-wysiwyg

A lightweight WYSIWYG HTML editor for Vue.js
https://chmln.github.io/vue-wysiwyg/
MIT License
555 stars 134 forks source link

fixed leftover selections lingering in some browsers after new styles applied #48

Closed rkoval closed 6 years ago

rkoval commented 6 years ago

I was having a weird issue where in some browsers (Chrome and Firefox, but not Safari), the selection that a style would be applied for would linger such that any subsequent style applications would occur to that original selection and not others. This would basically lead to behavior where you could only style your single first selection of text, and nothing else.

Curiously, I could not reproduce this behavior in the demo site for this repo, so I imagine something is conflicting in my setup that brought about this bug. Whatever the case, explicitly clearing the browser's selection along with the locally stored selection fixed the issue for me.

chmln commented 6 years ago

@rkoval amazing work, thank you. this also helped fix another bug I was encountering.

rkoval commented 6 years ago

i just realized i messed up the const vs. let, but i appreciate you merging and fixing that for me. sorry to add that to your workload though :)

thanks for the quick turnaround on this!