-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MoveNodeByPath broken? #2328
Comments
@skogsmaskin might it have something to do with the inconsistent behavior mentioned in #2192? |
@ianstormtaylor Yeah, that's probably part of the problem (the path annotation for the newPath param is very confusing). But I consider it a bug that it will actually delete/replace nodes like in the above fiddle? It should maybe throw an error instead until |
@skogsmaskin @ianstormtaylor I believe that the particular fiddle was not showing an actual break in I was able to get the operation to work as expected by changing the code to call the underlying I think the reason we were seeing that behavior was because of the slate/packages/slate/src/plugins/core.js Line 66 in 7a6de87
The jsfiddle is actually moving a (See tests in #2555) |
Is this fixed now? |
Doesn't seem to be fixed. I ended up using |
As of #3093 (which was just merged), I believe this issue is no longer applicable, because a lot has changed. I'm going through and closing out any potential issues that are not out of date with the overhaul. Thanks for understanding. |
Do you want to request a feature or report a bug?
I was trying to add some tests for the
by-path
commands, and tried adding a simple test for just switching positions of two blocks. I can't get it to work, it will just replace one of the blocks.I.e.
change.moveNodeByPath([0], [1], 1)
What's the current behavior?
It will replace one of the blocks leaving only one of the two blocks behind.
Relevant fiddle: https://jsfiddle.net/skogsmaskin/t54xc1ap/1/
What's the expected behavior?
As I understand moveNodeByPath it should not replace blocks, but just move it? I want to move the first block below the second one.
Could be I misunderstand something here, some input would be appriciated.
The text was updated successfully, but these errors were encountered: