fastmail/Squire

Invalid `setKeyHandler` `key` parameter type

Closed this issue · 2 comments

neilj commented

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.