Closed ioanmo226 closed 11 months ago
Re-initializing squire-rte
Looking at the proposed change, it looks like you are calling new Squire(...)
multiple times on the same root node? You should only ever have one active Squire instance managing the same DOM content, or you're going to have problems. Make sure you do editor.destroy()
on the old instance before creating the new one and you should be fine.
Although the first parameter for squire.setKeyHandler should be string, it's showing up as a number.
Yes, this is an error in the types. (For future, please create separate issues for separate things — that one we should fix).
Yep, you're right.
I forgot the destroy
function.
Once I destroyed the old instance and created a new one, everything worked fine. Thank you.
I've updated the issue title, description, and submitted a new PR.
Although the first parameter for squire.setKeyHandler should be string, it's showing up as a number. and displays type error https://github.com/fastmail/Squire/blob/311b8ee39e6c9a3dabb961baa54a6dfce438a17c/source/Editor.ts#L121C1-L121C1 https://github.com/fastmail/Squire/blob/311b8ee39e6c9a3dabb961baa54a6dfce438a17c/source/Editor.ts#L252C14-L252C14