Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving the editor causes a partial breakage of functionality #446

Closed
ddorstijn opened this issue Nov 8, 2023 · 3 comments
Closed

Moving the editor causes a partial breakage of functionality #446

ddorstijn opened this issue Nov 8, 2023 · 3 comments

Comments

@ddorstijn
Copy link

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
Copy link
Member

neilj commented Nov 8, 2023

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.

@ddorstijn
Copy link
Author

ddorstijn commented Nov 9, 2023

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?

@TehShrike
Copy link

See #327

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

No branches or pull requests

3 participants