Skip to content

Canceling turbo:click does not stop a frame navigation. #610

@manuelpuyol

Description

@manuelpuyol

Looking at the turbo:click docs:

Cancel this event to let the click fall through to the browser as normal navigation.

Though if your link triggers a frame navigation, running preventDefault() doesn't cancel it.


document.addEventListener('turbo:click', (e) => e.preventDefault()) on a Visit:

Screen.Recording.2022-06-23.at.4.25.54.PM.mov

document.addEventListener('turbo:click', (e) => e.preventDefault()) on a frame:

Screen.Recording.2022-06-23.at.4.26.51.PM.mov

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