Skip to content

How to preserve smooth scroll? #1070

Open
@Kody-Quintana

Description

@Kody-Quintana

I'm currently doing something like:

func hackyNavigate(newUrl string) {
	app.Window().Call("scrollTo", map[string]interface{}{
		"top":      0,
		"behavior": "smooth",
	})
	app.Window().Get("history").Call("replaceState",
		nil,
		"",
		newUrl,
	)
}

This "works" but it breaks my back button. Can anyone suggest how I can navigate between components without having the window immediately scroll to the top of the page?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions