Skip to content

Site Editor: Navigator's goTo function called twice when navigating screens in the sidebar #51760

@ciampo

Description

@ciampo

When interacting with the sidebar in the site editor, clicking buttons to navigate to a new screen seems to call the underlying goTo function twice:

  • one call is triggered (correctly) by NavigatorButton, used to render those buttons
  • one extra call seems to be triggered by the useSyncPathWithURL hook, in particular by this line of code

Calling goTo twice can prevent Navigator from working as expected — for example, when navigating to the previous/parent screen, the focus is currently not being restored correctly on the button that triggered the previous navigation

cc @youknowriad

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] Site EditorRelated to the overarching Site Editor (formerly "full site editing")[Package] Edit Site/packages/edit-site[Type] BugAn existing feature does not function as intended

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions