-
Notifications
You must be signed in to change notification settings - Fork 489
document.execCommand('insertOrderedList') fails in Firefox when target was template content #209
Comments
Reporting this with WebComponents version 0.5.4. |
@bigdave To clarify, was this working in firefox v25, or had you not encountered it until v26? |
@garlicnation Sorry - I don't know if it was working in v25, I simply have not encountered it until v26. I can not confirm how it was working before that. The issue is still present in Firefox nightlys today. |
Any document.execCommand that adds or remove nodes in the contenteditable element will corrupt the polyfill wrapper element childNodes. I tried to work on a fix for a while and it was too much work. I doubt this ever worked in the polyfill. |
Thanks for the issue. It has been a great while since this issue was opened. Sadly, this issue misses a live reproduction with the most recent version of the webcomponents polyfill for us to be able to debug and potentially fix. Versions 1 of the polyfills fix a large amount of issues, probably including this one as well. Please see the CONTRIBUTING.md for guidelines on filing issues. You can start from this jsBin template as a starting point and link it in the issue template under "Live Demo". Feel free to file a new issue following these instructions if you can still reproduce this issue with versions 1 of the polyfills. Thank you! |
When using Firefox and the webcomponentsjs polyfills, the commands
document.execCommand('insertOrderedList')
ordocument.execCommand('insertUnorderedList')
returntrue
, but fail to add the appropriate markup for list elements when called on a selection within acontenteditable
element which originated from within a template, and exists in Shadow DOM. If a similar area is added directly to a shadow root without having been cloned from a template, it seems to work still.Curiously, other commands, such as 'bold' do work as expected. This is demonstrated in the following fiddles.
Where I'm running into this as an issue is
contenteditable
inside of polymer elements, since they use templates.I'm seeing this behavior in Firefox as early as v26, and as recently as v37.
Steps to reproduce:
I have two fiddles, one demonstrating the functionality working inside of Shadow DOM, and one demonstrating the functionality failing inside of Shadow DOM when cloned from a template. These must be viewed from within Firefox in order for the failed one to fail, of course - it works in latest Chrome, Safari, Opera, and Vivaldi.
The text was updated successfully, but these errors were encountered: