Skip to content

Feature: Add more information about the source of abort signal (and navigateerror) #288

@atscott

Description

@atscott

Neither the navigateerror event nor the reason for abort on the abort signal provide information about why a navigation was aborted. There are many different reasons for this (user clicked the x button or escape key, a new navigation started, or a handler promise rejected) and routers may want to take different actions for each one.

Aside from the case where a navigation was canceled by a new navigation, “rolling back” the navigation by traversing to the previous entry is likely desirable, especially if the previous page is still displayed (It’d be a bit odd to display the previous page but the url is for the aborted navigation).

The only current way I can think of to tell if a navigation is aborted by a new navigation event is to wait a macrotask and check to see if a new event was observed during that period.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions