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.

Slate history refocusing causes "Incomplete set_selection operation properties" error

See original GitHub issue

Do 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.

  1. Open up an official slateJS example
  2. 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.
  3. Click away to lose focus.
  4. Click anywhere in the editor to gain focus.
  5. 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:open
  • Created 3 years ago
  • Reactions:18
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
TheSpydercommented, Aug 10, 2021

Is this still a problem in the latest release? #3616 should fix it

1reaction
ulioncommented, May 24, 2021

My final plan for this is to not produce incomplete set_selection op: https://github.com/xliulian/slate/commit/956b8733ddc001c52a2b59c76c930ad75b4c7b8a

Read more comments on GitHub >

github_iconTop 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 >

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