w8tcha / CKEditor-TextSelection-Plugin

The plugin that makes the editor keep it's text-selection when switching between WYSIWYG and Source mode, and scrolls the selection into the viewport.
MIT License
10 stars 7 forks source link

The plugin seems to prevent the content from changing when switching to source and back? #31

Closed dryoma closed 6 years ago

dryoma commented 6 years ago

Hi again,

Just tried the code from the master tree, and it seems with the plugin removes the contend entered in the wysiwyg mode.

On top of that, it doesn't seem to update between page reloads. Seem like some problem with caching to localStorage.

Tried in CKEditor 4.7.3 with a custom setup, and the latest 4.9.2 (clean setup, full bundle). This screencast has been made with the latter one on the sample page (it also has the utility span elements kept).

textselection-mode-switch

Can this be me doing something wrong? Thanks!

roadlittledawn commented 6 years ago

i encountered the same issue. it looked like the original html string that's stored in local storage wasn't being updated, so it always replaces editor content with that original string.

i ended up using the code prior to the local storage commit and it works well. i had to force clear cache by changing the timestamp in the ckeditor/ckeditor/ckeditor.js file.

haven't looked lately, but @w8tcha said he added some checks since i reported. haven't updated my code to use latest yet.

my issue FWIW: https://github.com/w8tcha/CKEditor-TextSelection-Plugin/issues/29

dryoma commented 6 years ago

Yeah, had to downgrade too (to 1.0.6, which has the bug described in #28 ).

w8tcha commented 6 years ago

Could you please try with the latest commit? I replaced the local storage function.

In my initial tests it appears to be working

dryoma commented 6 years ago

Yes, the fix worke, thank you! Sorry again to have taken so long to respond.