Skip to content
This repository has been archived by the owner on Apr 10, 2023. It is now read-only.

Not selecting images after Chrome 58 #155

Open
lyralemos opened this issue Jul 29, 2017 · 1 comment
Open

Not selecting images after Chrome 58 #155

lyralemos opened this issue Jul 29, 2017 · 1 comment

Comments

@lyralemos
Copy link

After updating to Chrome 58 (and above) selecting a image gives us an error:

Uncaught DOMException: Failed to execute 'setBaseAndExtent' on 'Selection': There is no child at offset 1. at Editor.eval (eval at <anonymous> (http://www.ufal.edu.br/portal_javascripts/Sunburst%20Theme/resourceplone.app.jquery-cachekey-f086f5c4645dd39c3fbe3cc5c64f88b7.js:12:11369), <anonymous>:1:15386) at Dispatcher.dispatch (eval at <anonymous> (http://www.ufal.edu.br/portal_javascripts/Sunburst%20Theme/resourceplone.app.jquery-cachekey-f086f5c4645dd39c3fbe3cc5c64f88b7.js:12:11369), <anonymous>:1:6059) at DOMUtils.c (eval at <anonymous> (http://www.ufal.edu.br/portal_javascripts/Sunburst%20Theme/resourceplone.app.jquery-cachekey-f086f5c4645dd39c3fbe3cc5c64f88b7.js:12:11369), <anonymous>:1:185038) at j (eval at <anonymous> (http://www.ufal.edu.br/portal_javascripts/Sunburst%20Theme/resourceplone.app.jquery-cachekey-f086f5c4645dd39c3fbe3cc5c64f88b7.js:12:11369), <anonymous>:1:58686) at HTMLDocument.y (eval at <anonymous> (http://www.ufal.edu.br/portal_javascripts/Sunburst%20Theme/resourceplone.app.jquery-cachekey-f086f5c4645dd39c3fbe3cc5c64f88b7.js:12:11369), <anonymous>:1:58844)

This doesn't happen in firefox or safari.

According to this it's is related to the recent updates in chrome's Selection API.

TinyMCE already fixed that in version 4.5.4 tinymce/tinymce@19f3098#diff-e5490c44bb1973bd0210940a7c159866

Since Products.TinyMCE use version 3.5.11 how do we fix this?

@mbarde
Copy link

mbarde commented Dec 13, 2017

Following tinymce/tinymce@19f3098#diff-e5490c44bb1973bd0210940a7c159866 replacing n.getSel().setBaseAndExtent(O,0,O,1) by n.select(O) in https://github.com/plone/Products.TinyMCE/blob/1.3.x/Products/TinyMCE/skins/tinymce/tiny_mce.js seems to fix this issue (tested with Producty.TinyMCE 1.3.27/Plone4.3.14 with Firefox and Chrome).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants