Skip to content
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

Not possible to use drag and drop within Submenus in the canvas #68178

Open
3 of 6 tasks
getdave opened this issue Dec 20, 2024 · 3 comments
Open
3 of 6 tasks

Not possible to use drag and drop within Submenus in the canvas #68178

getdave opened this issue Dec 20, 2024 · 3 comments
Labels
[Block] Navigation Affects the Navigation Block [Block] Submenu Affects the Submenu Block - for submenus in navigation [Type] Bug An existing feature does not function as intended

Comments

@getdave
Copy link
Contributor

getdave commented Dec 20, 2024

Description

The ability to drag and drop menu items within submenus appears to be impossible within the canvas. It should be possible to achieve this.

Step-by-step reproduction instructions

  1. Create submenus
  2. Try drag and drop within

Screenshots, screen recording, code snippet

Screen.Capture.on.2024-12-20.at.10-22-26.mp4

Environment info

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure
@getdave getdave added [Block] Navigation Affects the Navigation Block [Block] Submenu Affects the Submenu Block - for submenus in navigation [Type] Bug An existing feature does not function as intended labels Dec 20, 2024
@Infinite-Null
Copy link
Contributor

Hi @getdave I was successfully able to reproduce the issue and would love to look into it.

Screencast:

Screen.Recording.2024-12-23.at.1.24.46.PM.mov

@Rishit30G
Copy link
Contributor

Hey @Infinite-Null
I saw this issue a while ago, was replicating the issue so could debug that the issue might be in:
File: packages/block-library/src/navigation-submenu/edit.js
Variable: innerBlockProps

@Infinite-Null
Copy link
Contributor

Infinite-Null commented Dec 23, 2024

Hi @Rishit30G,

You’re absolutely right — I was working on the same file. After some research, I discovered that the issue occurs when an element is dragged and dropped; it consistently moves to the top of the list.

Here’s a screen recording of the behavior:

Screen.Recording.2024-12-23.at.4.37.29.PM.mov

Upon debugging, I suspect the issue might stem from const useIsDraggingWithin and innerBlockProps. However, I haven’t been able to pinpoint the exact cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block [Block] Submenu Affects the Submenu Block - for submenus in navigation [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants