Slate: HTML Serializer needs to use key-utils to generate compatible keys

Created on 3 Dec 2018  路  3Comments  路  Source: ianstormtaylor/slate

Do you want to request a _feature_ or report a _bug_?

bug

What's the current behavior?

If you have multiple editors on a page, and some create values using Value.fromJSON() and some use slate-html-serializer, then they data-keys will be confused because they index using different values.
This can cause different issues, but the one I noticed is that clicking in one editor will focus a different one.

What's the expected behavior?

unique keys in the data.

Workaround

After deserializing the object, you can toJSON() and then Value.fromJSON() to use key-utils indirectly.

question

All 3 comments

I believe this is an environment issue and is causing the slate-html-serializer to use a different key generator than the slate core library, which in turn causes the key collision problem.

Things to check for this problem:

  1. Duplicate slate dependencies in the yarn.lock file
  2. Incorporation of a second slate dependency via a yarn link to a library that also uses slate
  3. Potentially incorrect peer or dev dependency constraints

@JuanValencia did you come up with solution? I have the same issue with multiple editors losing focus.

Hey, thanks for using Slate! Unfortunately, we can't offer support for usage questions in the issues here because it becomes overwhelming to maintain the project if the issues are filled with questions.

However, we do have a Slack channel and people are constantly asking and answering questions in there. So I'm going to close this issue, but I definitely recommend joining the Slack channel if you want to find people that might be able to help.

Thanks for understanding!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bunterWolf picture bunterWolf  路  3Comments

JSH3R0 picture JSH3R0  路  3Comments

ianstormtaylor picture ianstormtaylor  路  3Comments

chriserickson picture chriserickson  路  3Comments

AlexeiAndreev picture AlexeiAndreev  路  3Comments