-
Notifications
You must be signed in to change notification settings - Fork 4.7k
[Commands]: Fix move to command condition for registering
#54049
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
Conversation
|
Size Change: +16 B (0%) Total Size: 1.51 MB
ℹ️ View Unchanged
|
|
This does work but it's a bit confusing, including in the block menu. If I have a group block with a spacer block in it and under the group block there is an image block:
What was the original idea of limiting to only block? I can understand no having the move to available if there is only one block in the whole document. Otherwise I can't say what purpose does the limitation serve? Normally if I can drag and drop I should be able to move to. Move to is a keyboard accessible way to moving blocks. |
That's good thoughts but I don't have insights about the original idea and not great suggestions at the moment, as the Whatever logic we should choose though, we should be consistent in all places we have the |
Mamaduka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's land this ✅
@draganescu, great observations that we should address alongside other "Move to" issues. I believe @t-hamano created a few of those recently.
t-hamano
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
For now, I think it would be better to allow the command only if there are multiple blocks on the same level as well, to be consistent with the "Move to" menu on the block toolbar. As far as I know, this logic was introduced in #44827.
However, as @draganescu said, even if there is only one block on the same level, you can drag and drop it out of the parent block. Perhaps as a follow-up, to be more consistent with drag and drop, the "Move To" action should be allowed only when there is only one block in the entire document, both on the block toolbar and in the command.
Incidentally, the most serious problem we are experiencing in the Move to action is #54016, where the browser freezes when trying to move it into itself 😅
Oh... look at that.. I had introduced this logic 😆 |
What?
Follow up of: #53994, addressing @t-hamano 's comment for fixing the condition where the
move tocommand should be available.Testing Instructions
move tocommand should not be available when we have only one block at the first parent. Example is create a Group block and inserter just one block. Then test the command availability to that child block.