Delayed setState(value) results in Cannot resolve a DOM point from Slate point
See original GitHub issueDo you want to request a feature or report a bug?
What’s the current behavior?
Repro: https://codesandbox.io/s/slate-reproductions-1sbiz
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:
- Created 3 years ago
- Reactions:9
- Comments:28 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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) inslate-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.
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.