fastmail/Squire

Moving the editor causes a partial breakage of functionality

ddorstijn opened this issue · 3 comments

When moving the element that the squire editor is bound to, the editor loses part of its functionality.

An example can be found here:

https://github.com/ddorstijn-usoft/squire-editor

This uses lit element but the idea should remain the same.

Pressing the bold button for example after moving generates the following error:
afbeelding

Also after pressing the undo button the value of the editor will be undefined

neilj commented

It's unclear to me from that link what exactly you're trying to do. Do you have a minimal test case using the Demo.html file in the repo? If you're changing the root node for Squire, you need to destroy the old instance and create a new one.

It doesn't happen when not using a web component. So I'll close the issue. There seems to be something going wrong with getting ranges and the undostack from the webcomponent when the element has moved. Using shortcuts does still work interestingly enough.

I do wonder if the possibility to use the shadow DOM would solve this issue. Are you planning on ever supporting this?