Skip to content

Navigation: Possible to create two navigations by mistake #56248

Closed

Description

@scruffian

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

Activity

  1. getdave commented on Nov 17, 2023

    @getdave
    Contributor

    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.

  2. getdave commented on Nov 21, 2024

    @getdave
    Contributor

    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"
    />

  3. added
    Good First IssueAn issue that's suitable for someone looking to contribute for the first time
    on Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good First IssueAn issue that's suitable for someone looking to contribute for the first time[Block] NavigationAffects the Navigation Block[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions