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

Navigation Block: dragging a block in List View modal causes the modal to close unexpectedly #34254

Closed
2 tasks done
talldan opened this issue Aug 24, 2021 · 7 comments
Closed
2 tasks done
Labels
[Block] Navigation Affects the Navigation Block [Feature] Drag and Drop Drag and drop functionality when working with blocks Needs Testing Needs further testing to be confirmed.

Comments

@talldan
Copy link
Contributor

talldan commented Aug 24, 2021

Description

As soon as a user drags a block in the List View modal it closes unexpectedly.

This feature worked when the drag and drop feature was introduced, so this appears to be a regression.

Step-by-step reproduction instructions

  1. Add a navigation block with some links inside it
  2. Select the navigation block and open the list view from the block's toolbar
  3. Try dragging one of the blocks

Expected: It's possible to drag and drop a block
Actual: The modal closes unexpectedly and the drag operation is cancelled

Pre-checks

  • I have searched the existing issues.
  • I have tested with all plugins deactivated except Gutenberg.
@talldan talldan added [Type] Regression Related to a regression in the latest release [Feature] Drag and Drop Drag and drop functionality when working with blocks [Block] Navigation Affects the Navigation Block labels Aug 24, 2021
@jasmussen
Copy link
Contributor

CC: @gwwar in case you have any ideas.

@talldan
Copy link
Contributor Author

talldan commented Aug 26, 2021

I'm not actually experiencing the issue now. I wonder if my build had some issues. Let me know if you can reproduce, but if not I'll close this tomorrow.

@talldan talldan added Needs Testing Needs further testing to be confirmed. and removed [Type] Regression Related to a regression in the latest release labels Aug 26, 2021
@gwwar
Copy link
Contributor

gwwar commented Aug 26, 2021

This will likely happen if a drag-&-drop triggers the primary onClick handler

@gwwar
Copy link
Contributor

gwwar commented Aug 26, 2021

FWIW I'm not able to trigger this on trunk, so it's probably okay to close out.

@gwwar
Copy link
Contributor

gwwar commented Aug 26, 2021

🤔 So I dug around a bit, and I think the modal closing on a navigation block item select is a side-effect of the selected block focus (which is technically outside of the modal). I'll spin up a smaller PR that alters this behavior so the modal remains open on select, it doesn't appear like this was intentional.

@talldan
Copy link
Contributor Author

talldan commented Aug 27, 2021

Hmm, yeah. I haven't been able make it happen again!

I wonder what it was. I had a hunch that maybe LinkControl was stealing focus when a navigation link doesn't have a URL, but that doesn't seem to be the case.

@gwwar
Copy link
Contributor

gwwar commented Aug 27, 2021

With changes in #34337 this should no longer be possible 👍

@gwwar gwwar closed this as completed Aug 27, 2021
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 [Feature] Drag and Drop Drag and drop functionality when working with blocks Needs Testing Needs further testing to be confirmed.
Projects
None yet
Development

No branches or pull requests

3 participants