Slate history refocusing causes "Incomplete set_selection operation properties" error
See original GitHub issueDo you want to request a feature or report a bug?
Bug
What’s the current behavior?
This following procedure causes the editor to throw Error: Cannot apply an incomplete "set_selection" operation properties {"focus":{"path":[0,0],"offset":6}} when there is no current selection.
- Open up an official slateJS example
- Select and delete two or more parts of the elements in the editor. Note that deleting part of one element or two of more full elements do not cause this error.
- Click away to lose focus.
- Click anywhere in the editor to gain focus.
- Try to undo with
HistoryEditor.undo
(control/command + Z).
JSFiddle: here
Slate: 0.59.0 Slate React: 0.59.0 Slate History: 0.59.0 Browser: Chrome OS: Mac
What’s the expected behavior?
Undo should reverse the last action instead of throwing an error.
My Best Guess
I am new to SlateJS but my best guess of this error is that when the user clicks away and then into the editor, the selection does not get updated by Slate, which is why to Slate there is no current selection. After the user clicks into the editor to refocus, if the user updates the selection by typing something or deleting something else, then this error wouldn’t occur.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:18
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Slate history error: Cannot apply an incomplete "set_selection ...
I hit this as well in my real-time collab implementation, I apply operations to an off-screen editor with no selection and the partial...
Read more >Untitled
#thiar Baal veer 31 january 2014 youtube, Tcs registration last date, Whopperjawed origin, St anthony tattoo padova, Sky top 100 documentaries, ...
Read more >Deconstruction in pgh: What is thes
Figure 1.2: Median Household Income and Demolished Properties . ... history, buildings stock, and its overall openness to deconstruction.
Read more >Source code documentation - OMFIT
retrieve the value of the property as seen by the user. setProperty (property ... Thus, constraints far from the natural spline will cause...
Read more >The Multi-Agent Transport Simulation MATSim - OAPEN Library
Chapter 6: MATSim Data Containers (Marcel Rieser, Kai Nagel and Andreas Horni) 55. 6.1 Time-Dependent Network. 55. 6.2 Person Attributes and Subpopulations.
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 Free
Top 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
Is this still a problem in the latest release? #3616 should fix it
My final plan for this is to not produce incomplete set_selection op: https://github.com/xliulian/slate/commit/956b8733ddc001c52a2b59c76c930ad75b4c7b8a