Join GitHub today
Fix move block to position bug; Add test cases; #14924
On #14003 I missed a case where a restriction was still not being applied and the moving blocks were possible when it should not be.
Basically, if an InnerBlocks are contained templateLock insert we should be able to move inside the area but not move an InnerBlock to another root block, that move was still possible.
I also add test cases to the moveBlockToPosition action.
How has this been tested?
Add the blocks available in https://gist.github.com/jorgefilipecosta/c9a9cc1c5199aca6786413492c302ccd.
Hi @nosolosw, the blue line appears in most cases even if the move ends up not being possible (e.g: allowed blocks restrictions, child blocks) so the fact that the blue line appears in this PR is a general problem.
I think we should address the general problem. I think we should expose a selector canMoveBlock... similar to canInsertBlock and in the drop zones components, we can use that selector. I think we can first merge this PR to avoid merge conflicts and then I can apply the refactor.