Slate: move_node history doesn't pay attention to path changes of other nodes

Created on 15 Nov 2017  Â·  6Comments  Â·  Source: ianstormtaylor/slate

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

Bug

JSFiddle

screen recording 2017-11-15 at 10 11 pm

Let's assume we have a node(key: 1) with path 0,0
and a second one, node(key: 2) with path 0,1

If we move the node at 0,0 to 0,1
node(key: 2) will no longer be found at 0,1 but 0,0; as node(key: 1) was pushed away
Hence no undo is possible

The undo history will have the following record:

newPath: [0, 1]
path: [0, 0]
type: "move_node"

So when we hit undo, there will be an error: Could not find a descendant at path "0,1" as node(key: 2) is no longer at 0,1, but at 0,0

bug ♥ help

All 6 comments

Updated

@emilbruckner I'm not sure I understand what you're saying still. The error displayed in the GIF doesn't seem like the same error you're describing?

@ianstormtaylor It's not about the warning error, but about Could not find a descendant at path …-Error. It just appears for about a second at the end of the gif

@ianstormtaylor Just curious, have you taken a look at this jsfiddle yet?

Undo just doesn't work on what I think is a legitimate operation …

This issue hasn't had a response in a while, and it's unclear if it's still present in the latest versions of Slate. To keep the issues easier to manage, since there are so many being opened every day, I'm going to close this old one out.

But if you notice that the bug is still happening, please feel free to comment and it can be revisited. It might be an edge case that not many people run into, in which case the fastest way to get it fixed would probably be to write a pull request for it.

Thanks for understanding!

@ianstormtaylor Seems like this is resolved! At least the example works now.

Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

YurkaninRyan picture YurkaninRyan  Â·  3Comments

markolofsen picture markolofsen  Â·  3Comments

ianstormtaylor picture ianstormtaylor  Â·  3Comments

AlexeiAndreev picture AlexeiAndreev  Â·  3Comments

ezakto picture ezakto  Â·  3Comments