question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Delayed setState(value) results in Cannot resolve a DOM point from Slate point

See original GitHub issue

Do you want to request a feature or report a bug?

What’s the current behavior?

Repro: https://codesandbox.io/s/slate-reproductions-1sbiz

Kapture 2020-04-02 at 17 24 18

Slate: 0.57.1 Browser: Chrome OS: Mac

What’s the expected behavior?

The above repro shows how a delayed setState(value) call systematically results in the error Cannot resolve a DOM point from Slate point.

In my case, I’m using Apollo to keep some text in sync with the server, I have optimistic updates in place, but it’s still not quick enough to not trigger this error.

I also encountered the same issue while trying to sync with some quite large (and badly written) Redux store.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:9
  • Comments:28 (4 by maintainers)

github_iconTop GitHub Comments

11reactions
skogsmaskincommented, Apr 28, 2020

This is a problem when doing collaborative editing. Say user A has focus on line 2. User B removes the line above (line 1). As far as I can tell there is no way I can adjust the selection for user A before editable (https://github.com/ianstormtaylor/slate/blob/master/packages/slate-react/src/components/editable.tsx#L162) in slate-react tries to update the selection itself and fails because now line 2 no longer exists.

So far I have forked slate-react and just fail silently, and then adjust the selection myself.

7reactions
TheSpydercommented, Sep 20, 2021

It’s still needed to read the editor contents, but yes value should only be provided on startup. If we could make it readonly, we would.

Modifications to value must be done via Slate APIs - and only via the APIs - I’m not sure where our documentation falls over trying to explain this but clearly it does.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Cannot resolve a DOM point from Slate point
Once the new value is set, the cursor ends up getting lost, because the point that it was at no longer exists. Definitely...
Read more >
Untitled
Ube coconut rice balls, Like 125 scooter price, Unicorn wizard hisoka, ... Brave frontier arena points, Recensioni going club iliade djerba, ...
Read more >
Untitled
Iodobutane melting point, Day of the triffids review book, Sedrun station, ... Aiino custodia macbook pro 15, Nchsaa 3a track and field results, ......
Read more >
Javascript Analytics | Hitchhikers - Yext Hitchhikers
Earn Double Points all December long! ... strings = response.data.response.results.map(function(r) { return r.value; }); ... Can't find what you're looking for?
Read more >
Moving away from ReactJs and VueJs on front-end using ...
In addition, this architecture must help us in the next points: ... amount of code that could not change when we modify ReactJS...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found