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: Possible to create two navigations by mistake #56248

Closed
scruffian opened this issue Nov 17, 2023 · 2 comments · Fixed by #67488
Closed

Navigation: Possible to create two navigations by mistake #56248

scruffian opened this issue Nov 17, 2023 · 2 comments · Fixed by #67488
Labels
[Block] Navigation Affects the Navigation Block Good First Issue An issue that's suitable for someone looking to contribute for the first time [Type] Bug An existing feature does not function as intended

Comments

@scruffian
Copy link
Contributor

Description

The "Create a new menu" option in an empty block is possible to double click:
Screenshot 2023-11-17 at 10 59 31

If you do that you accidentally create two navigations by mistake

Step-by-step reproduction instructions

  1. Add a navigation block
  2. Delete the navigation CPT that the block is using
  3. You should now see a prompt that says "Create a new menu".
  4. Double click
  5. Notice that two navigations are created.

Screenshots, screen recording, code snippet

No response

Environment info

All

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

@scruffian scruffian added [Type] Bug An existing feature does not function as intended [Block] Navigation Affects the Navigation Block labels Nov 17, 2023
@getdave
Copy link
Contributor

getdave commented Nov 17, 2023

I wonder if we ought to move these actions to the Core Data store? That way they would be global and we could therefore globally observe their state via useSelect and control the UI accordingly.

@getdave
Copy link
Contributor

getdave commented Nov 21, 2024

This is still possible today. We should immediately disable the button after it's been clicked.

Logic can be added here pretty easily

<Button
__next40pxDefaultSize
onClick={ onCreateNew }
variant="link"
/>

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 Good First Issue An issue that's suitable for someone looking to contribute for the first time [Type] Bug An existing feature does not function as intended
Projects
None yet
2 participants