Skip to content

incorrect behaviour of "routing-event"s #484

Description

@nightnei

history.pushstate and history.replacestate have 3 parameters. and the third parameter is URL, which is optional.
https://html.spec.whatwg.org/multipage/history.html#dom-history-pushstate

so even if we use window.history.pushState({}, '') - events single-spa:before-routing-event and single-spa:routing-event will be fired and method isActive of every registered app will be run;

our case: we use https://github.com/mapbox/scroll-restorer in our service https://github.com/namecheap/ilc. and scroll-restorer saves scroll position in the state of history. it's important if we use back/forward buttons in a browser. so every time when a user just scrolls page - it uses pushstate and in result - single-spa think that route is changed.

https://github.com/single-spa/single-spa/blob/108292928d225e1fd7c80245f2d6d6128edd4ee5/src/navigation/navigation-events.js#L124`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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