-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Error when dragging and dropping inner blocks of the navigation block #30177
Comments
The error seems to only happen when dragging the navigation link block. I don't get the error when dragging the page list block within the navigation block. |
Summarizing a chat with Ella, we found that there's custom dragging logic added in navigation link from #24479. What we can try here is removing this and revert the ability to drag items into submenus. The breakage here is blocking another round of feedback for Full Site Editing. @jasmussen also noted that #29727 might be the preferred way of handling submenus. |
Just to follow up, I'm going to move forward with the Call For Testing rather than waiting for an additional plugin release but am going to note this issue as a known problem. Currently, I adjusted the steps as well to avoid this action being taken which, isn't ideal, but removes the blocker :) Thank you all for the quick work in digging into this. |
For folks 👀 this issue, if we decide to add back support for dragging items into submenus, one thing to be aware of is to aim for solving the general case, instead of adding custom code in the block:
|
I don't think it's unreasonable for it to have been implemented in the way it was. There are other instances where things that seem like they should be handled as part of the block API are first implemented within a block (#28405 is a recent one that comes to mind). From what I understand, the navigation block is still the only block that has collapsible nested blocks, so it's hard to generalise an API on the basis of a single use case. It's also pretty common for something to be implemented initially in a more custom way which then graduates to a core feature. Do we have an idea of what the root cause of this issue is? I don't think removing a feature that worked perfectly well at first, but now exploits what seems to be a bug in some unrelated code is the right way of considering this solved. |
The problem seems to be related to the use of the I think I can get the feature working without that selector. PR incoming. |
#30219 fixes without removing the feature. |
Thanks for the alternative @talldan!
So far, I'm thinking we're re-rendering too many times and calling the selector is somehow triggering additional renders until we hit the queued update limit. We normally would see this type of react error from calling setState too many times inappropriately. I'm still searching but it might be good to tune this. Folks did notice that typing used to slow down with the list view open in the site-editor while typing in navigation but not in paragraph blocks, so this might be good to optimize regardless. |
#30274 makes a small change that takes us closer to the resolving the root cause. Still unsure why |
I managed to get a crash today, and posting here because it seems relevant to what @gwwar mentions about re-rendering too many times: What I did was:
I'm getting in the console this error: |
@jasmussen Do you get the error with @talldan's PR #30274? |
Thanks for following up on this! |
Great! |
Description
Block drag and drop seems to be buggy in the navigation block.
When dropping a block, often the block disappears, and an error is thrown in the console:
The stack trace seems to indicate an error with one of the rich text formats.
Originally reproduce in the navigation editor, but also happens in the post editor.
Step-by-step reproduction instructions
Expected behaviour
It works
Actual behaviour
The dragged block disappears on drop
The text was updated successfully, but these errors were encountered: